You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
OS: Windows 10 sysinfo version: v0.30.5
When running a small Rust binary that uses sysinfo to print out process stats, I noticed that the reported virtual memory is ~5MB but the physical memory is ~15MB. According to the docs, virtual memory should always include the physical memory size and then add additional address space from paged regions, etc.
Here is what Resource Monitor shows for the process:
This is what Task Manager shows:
The "Private" memory is what Windows considers to be the uniquely allocated memory of the process:
I looked into the Windows code here and I think there is a case to be made to use a different value than WorkingSetSize for the physical memory of the process.
The question is how is this value calculated? It seems to be the "Working Set Size" minus the "Shareable" memory.
Thoughts?
To Reproduce
Run a small Rust app that prints out the virtual and physical memory using sysinfo.
The text was updated successfully, but these errors were encountered:
Seems to me like this header is for internal use only and is unstable across Windows versions.
This documentation claims that GetProcessMemoryInfo can also provide this information, but as it turns out only using the PROCESS_MEMORY_COUNTERS_EX2 struct which is only available on Windows 10 22H2+.
I suppose we can use the internal use only API for the time being, wouldn't be the first time for windows. Surprisingly enough, they almost never change. Interested into sending a fix?
I can take a stab at it this weekend, but I'm not super familiar with Rust yet (beginner-intermediate), so no guarantees on producing something workable.
Describe the bug
OS: Windows 10
sysinfo
version: v0.30.5When running a small Rust binary that uses
sysinfo
to print out process stats, I noticed that the reported virtual memory is ~5MB but the physical memory is ~15MB. According to the docs, virtual memory should always include the physical memory size and then add additional address space from paged regions, etc.Here is what Resource Monitor shows for the process:
This is what Task Manager shows:
The "Private" memory is what Windows considers to be the uniquely allocated memory of the process:
I looked into the Windows code here and I think there is a case to be made to use a different value than
WorkingSetSize
for the physical memory of the process.The question is how is this value calculated? It seems to be the "Working Set Size" minus the "Shareable" memory.
Thoughts?
To Reproduce
Run a small Rust app that prints out the virtual and physical memory using
sysinfo
.The text was updated successfully, but these errors were encountered: