Monday, September 2, 2019

windows - How to find the total virtual memory used by the process?



I am trying to find out how much total virtual memory the process occupies, including the swapped/cached/pagefile-d (however you call it, that is on disk). All the stats that I can get in the Task manager seem to be refering just to the space occupied in the physical RAM:



enter image description here




Here are the memory columns I've chosen:



![enter image description here



I didn't see any other that would correspond to what I want. The value is supposed to be around 2GB, according to what R reports by gc() and memory.size():



gc()
# used (Mb) gc trigger (Mb) max used (Mb)
# Ncells 1361878 72.8 2309944 123.4 1737286 92.8
# Vcells 254023597 1938.1 614368770 4687.3 611808900 4667.8

memory.size(FALSE)
# [1] 2051.88
Sys.getpid()
# [1] 8544


(Nevertheless, the "max used" reported by gc() seems to correspond pretty well with the "Peak working set"; not sure if this one refers to the total virtual memory or just the physical.)


Answer



The quantity that most likely corresponds to your question is "Commit size".




All these quantities are explained in the Microsoft blog article
Windows Process Memory Usage Demystified.



To quote:




Committed pages may be accessed by your application. The system guarantees that when you access a committed page, there will be physical memory to back it up. The physical memory is allocated on-demand, when you first access the page. Even though the system doesn’t allocate physical memory immediately, this guarantee implies that there is a system-wide limit on how much memory can be committed by all processes. This limit is called the commit limit. If an allocation would exceed the commit limit, the system does not satisfy it.



No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...