Process Explorer not showing the biggest user of my RAM

Does anyone know why Process Explorer might show these weird values for memory usage of my Virtual Box instance?

Here are the real numbers:

vmmap

But here's what Process Explorer is showing:

alt text

alt text

So the process has committed 1.2 GB of VM, 1.1 GB of which is private. But Process Explorer is only seeing 196 MB of VM, and only 48 MB of private memory! What's going on here?

EDIT: This memory is not just reserved. It actually gets used:

alt text


Solution 1:

Mark Russinovich has kindly explained that this occurs because VirtualBox locks a large amount of memory, which requests the OS to keep it in the working set.

However, if you just try VirtualLocking a bunch of RAM, you won't see this. All that RAM will be happily accounted for, like it should be. So it's something else about the way VirtualBox allocates this memory. Incidentally, it also affects ProcessHacker.

The weird thing about this is that ProcessHacker enumerates all the allocated memory ranges correctly, and simply adding them up will give the correct value, however the counter reported by the OS is wrong. By a few GB. Not good!

I'm calling this a quirk of Windows RAM reporting. I'd call this a bug, but it's probably been around for at least a decade, so by now I guess one can call this expected behaviour... one that isn't properly worked around in Process Explorer nor Process Hacker.

Solution 2:

Using SysInternals RamMap I think you can see the ram is recorded as 'DriverLocked'.

However I've no idea how you actually work back from this to the driver which locked it. And importantly, the driver is not going to be the VirtualBox program, but rather a driver that VirtualBox installed and uses.

If simply shutting down virtual machines doesn't free up ram from the 'DriverLocked' pool, then you can use a tool like AutoRuns to see what drivers are loaded at startup and disable them. It's a bit of a manual process so would be really interested if anyone knows how to tell what drivers have locked memory.