While investigating a SLElement leak, I noticed that the task manager represented a value of 9.8gb whereas the Microsoft platform element is showing 10.3GB.
I took a memory dump in SLLogcollector and it represented as 10.1GB after opening the zip i see the size is 10.4GB in the dump.
Which value should be the correct one here and why are there so many different values represented?
There are different columns available in the task manager, so it's not clear to which one you're looking at. Also the Microsoft Platform has different columns.
There are different types of memory for a process: private bytes and shareable bytes, both can be either committed or reserved allocation types.
Private virtual memory means that the data is only used by this process, examples are stack, heap,...
Shareable virtual memory means that data can be shared across processes, examples are an image, mapped file,... (can be shared, does not necessarily mean that different processes are actually using the same piece of memory). For shareable memory it can then mean that one process indicates "I'm using 1GB shareable memory", another process could indicate the same thing. Then you can't sum them up and think that there is 2GB in use as both processes could be referring to the same piece of data in memory. It could of course be that it are 2 different pieces of data and then it is indeed 2GB in total, but you don't know that.
The allocation types are:
-Reserved: address space is reserved, but doesn't contain any data yet: this has no physical memory impact (in earlier Windows versions it did had an impact, but not anymore)
-Committed: address space is in use and contains data, this has a physical impact (RAM, paging file)
As for the available columns there are:
-Private Committed bytes: this is the Commit Size column in Task Manager = VM Size column in Microsoft Platform
-Private + Shareable committed bytes in RAM (not paging file): this is the "Working set (memory)" column in Task Manager = Memory Usage column in Microsoft Platform
-Private + Shareable committed and reserved bytes: this is the Virtual bytes column in Microsoft Platform
Note that Task Manager column names tend to change across different Windows versions.
It's not easy to answer the question "which value should be the correct one", it's depending on what you're interested in. Each column has a different purpose. The VM Size column would be interesting to see if there's a memory leak (note that you won't be able to detect with this column is the leak is in the shareable memory). The Memory Usage only shows the amount of data in RAM, if it's writing a lot of data in a paging file then you don't know with this column if there's a memory leak or not, or how much physical memory is being used in total but it could be an indication to see if more RAM would be needed. The Virtual bytes column is mostly handy for 32 bit processes such as SLProtocol, if that value reaches 4GB then there will be a crash of the process due to the memory limit. As SLElement is a 64bit process, this column is not that interesting as 64bit processes tend to reserve a lot of memory address space, so you see this as a very high number without it actually using that amount of data in memory.