36

There's something about Windows memory management and it's relationship to TaskManager that I don't understand and I'm hoping someone can enlighten me.

If I'm running a virtual machine (doesn't matter if it's Virtual PC 2007, Virtual Server 2005, or VirtualBox since they act the same way) and bring up TaskManager I can see on the processes tab some entries for the VM but the memory values are fairly small (around 30 MB). Obviously it's not including the memory actually being consumed by the VM itself. None of the various Memory-related columns you can make visible appear to work differently. The Memory usage on the Performance tab appears to be correct for total memory usage including the VM.

So my question is why doesn't the VM's memory usage (which will be 100's of MB) show up on the Processes tab?

wzzrd
  • 10,269
  • 2
  • 32
  • 47
Scott Bussinger
  • 1,761
  • 4
  • 23
  • 27

3 Answers3

39

VirtualPC, HyperV and probably similar products use something called driver locked memory, which is not visible in Process Explorer, Task Manager, etc. RAMMap will show you driver locked memory used by a process.

Sajee
  • 854
  • 1
  • 11
  • 16
  • 1
    For the record RAMMap is Vista or higher only. – Tim Abell Feb 21 '12 at 14:24
  • 1
    RAMMap did not show locked memory for a process, it did show total locked memory tought – NeDark Jun 07 '14 at 04:02
  • 1
    Just to point out for others, he did not say process locked memory. He said _driver_ locked memory. It's how dynamic memory works. If you don't like it, or think it is messing with your app, then you can just configure the VM for static memory instead of dynamic. I have seen some java apps have issues when using dynamic memory in a VM, setting them to static _fixed the glitch_. – John C Apr 04 '16 at 15:18
  • What process does actually allocate that memory? I have tried [SysInternals' VMMap](https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap) and when you pick the right `VBoxHeadless.exe` process (it's a leaf on the process tree branch, i.e. it doesn't have any other child, you can use for example Process Explorer to find it), that "lost" memory appears under both _Private Bytes_ and _Working Set_ of that process (even though Process Explorer is showing much less for both values). So I'm a bit confused why they're showing different values but **VMMap appears to show the real number**. – David Ferenczy Rogožan Oct 07 '19 at 17:50
  • Looking at RAMMap, VMWare Workstation Player seems to be using memory mapped files instead of driver locked memory. My driver locked memory use is way too small for the entire guest OS. – relatively_random May 25 '22 at 11:37
6

Any hosted virtualization system like the ones you listed will include a device driver which runs within the host OS's kernel. This is necessary as user-mode programs can't issue the instructions necessary to create a virtual machine.

The reason that you don't see the memory in task manager is that you're looking at memory for the user-mode programs associated with the virtual machines, and not the kernel-mode device driver which actually allocated the memory for the VMs.

Jake Oshins
  • 5,116
  • 17
  • 15
  • What process does actually allocate that memory? I have tried [SysInternals' VMMap](https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap) and when you pick the right `VBoxHeadless.exe` process (it's a leaf on the process tree branch, i.e. it doesn't have any other child, you can use for example Process Explorer to find it), that "lost" memory appears under both _Private Bytes_ and _Working Set_ of that process (even though Process Explorer is showing much less for both values). So I'm a bit confused why they're showing different values but **VMMap appears to show the real number**. – David Ferenczy Rogožan Oct 07 '19 at 17:51
6

To view the amount of memory in use by a VM, you need to ensure that you have the Working Set column visible in your Task Manager. Often only the Private Set is visible.

To enable this column:

1) Start Task Manager

2) Go to Processes tab

3) View > Select Columns

4) Ensure that "Memory - Working Set" is ticked

For example, the Private Set of the VM I have running at the moment is 43mb, whereas the Working Set is 2.3Gb

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
  • 1
    What is full amount of memory application uses? Working set + Private set or just Working set? – zendar Jun 09 '09 at 11:35
  • 2
    Perhaps it's different in different versions of Windows, but under Windows 7 that's not what I'm seeing. The "Working Set" numbers are larger than the "Private Working Set" numbers, but not remotely enough to account for the VM's memory. I've tried all of the memory related columns and none of them do. This is with both Windows Virtual PC and VirtualBox. What version of Windows and what VM host are you using? – Scott Bussinger Jun 09 '09 at 18:36
  • Unfortunately, there is no single number that indicates "how much memory" a process is using, since you get into complications like shared memory, file-mapped memory, paged-out memory and a few others. Here's a good explanation of a few concepts: http://stackoverflow.com/questions/1984186/what-is-private-bytes-virtual-bytes-working-set – tylerl Jul 30 '10 at 20:06
  • I don't think the _Working Set_ is telling you anything useful in this case. Inside the VM, it's reporting that it uses about 6 GB of memory while VirtualBox's processes don't consume more than 100 MB in their _Working Sets_. – David Ferenczy Rogožan Oct 07 '19 at 17:56