How to map the address space of a process on Windows and Linux

During a recent Datadog event, how to get detailed memory usage on both Windows and Linux was at the center of discussions. One of the goals is to be able to figure out how to improve the memory footprint of our profilers. It happens that, back in 2007, when Jeff Richter and I wrote the 5th edition of Windows via C/C++, chapter 14 shipped a tiny sample called 14-VMMap: a ~560-line GUI demo that walked a process address space with VirtualQueryEx and dumped every region into a list box. It was a teaching tool - just enough to see how reserve/commit and the different storage types are laid out in memory. ...






































































