Mysteries of Memory Management Revealed (Part 1/2)
Why Stack Overflow recommends it
Stack Overflow users link it when someone is confused about why Windows tools report different memory numbers (committed, working set, private, reserved) for the same process.
Recommended by 2 people across 2 different months, 2016 to 2020.
What it is
A conference talk (part 1 of 2) by Mark Russinovich on how Windows manages memory, covering virtual address space, committed vs. reserved memory, working sets, and how physical memory moves between states. It uses Process Explorer, VMMap and RAMMap to show what Task Manager's memory numbers actually mean.
What people said
Strong rec Eugene · 2020-09 · Stack Overflow · on “why running garbage collector sometimes increase reserved ram java?”
These types of questions are never easy, mainly because to get it "right", the person asking them needs to have some basic understanding of how an OS treats and deals with memory; and the fact that there are different types of memory (at least resident , committed and reserved ). I am by far not versatile enough to get this entirely right too, but I keep learning and getting better at this. They mean very different things and some of them are usually irrelevant (I find reserved to be such). You are using windows, as such this, imho [this video] is a must watch to begin with. After you watch that, you need to move to the JVM world and how a JVM process. The heap is managed by a garbage collector,
Recommends mlvljr · 2016-10 · Stack Overflow · on “Memory usage: Commit, Working Set, Shareable, Private different with VS2015 Diagnostic Tools”
I suggest watching [this video] (and the 2nd part) as potential refresher and source of insight on why tools may report different numbers for what they would name similarly, etc.
Cites Laythe · 2017-03 · Stack Overflow · on “Stopping an application from allocating memory before it exhausts the Windows (or any OS) page file”
I am currently facing a situation where my C++ OpenGL based application deliberately allocates huge amounts memory for resources. In fact, so many that Windows just stops and I get a completely blank screen. Afterwards, I found out (randomly - Windows didn't even tell me!) that Windows was forced to extend my page file to 30GB. For applications with potentially large Private Memory usage, but also having the need to run on low memory hardware as well as take advantage of hardware with lots of memory, then some sort of scheme to detect max mem usage (and the appropriate action) must be devised. In this case, I would of thought we want to ride the fine line between too much allocation to push