Display metrics of the process with the biggest committed working memory

About ZBiggestProcess


Windows exposes a few more metrics in its api than is available to see in Task Manager. ZBiggestProcess shows some of the metrics of the highest memory commited process and displays it as an overlay on screen.

NtQuerySystemInformation with the SystemProcessInformation flag is the heart of this project. The metrics from this method is what the overlay uses to display. Using this method was not as straight forward as I thought, as it returns an array of packed SYSTEM_PROCESS_INFORMATION elements that need to be travered. Each element is packed in memory and can be a different size, so NextEntryOffset needs to be looked at for every element. Once that is all handled getting access to the metrics is very straight forward. All up the project is less than 100 lines of C code.

Findings

  1. Not a surprise really, but for my system electron apps and web browsers generally use the most memory. At times certain programs (like the 10x editor) can use more but drop back down.
  2. Certain apps allocate and deallocate way more often than I realized. I found the Discord desktop app to allocate and deallocate many times for every mouse motion (this is more than suspicious).
  3. This was my first project with the 10x editor and I'm liking it more and more every day. A great program.
  4. Some windows internal processes consume a huge amount of memory at times. A process called Memory Compression had the highest peak memory usage at times with a few gigabytes committed.
  5. Blting straight to the screen is quite easy and nice in Windows if in a rush. Bypassing all the logic for window handling allowed me to produce something in the very little time I had for this jam.
  6. Jams are fun even for small projects :)

Possible updates

  • Add more of a UI for the overlay and add controls in the system tray. Originally planned for the jam but scrapped due to time.
  • Add more real time visualizations for memory usage, would be nice to graph eggregious apps like the Discord Desktop app in terms of memory allocations.
Read more
Filters

Recent Activity

&zbiggestprocess jokes, last minute addition to show historical max peak mem usage process. We have new winners 🙂

View original message on Discord

&zbiggestprocess Calling it there for the jam. Added peak memory usage stat. Overlay always displays the process with the biggest working memory set. I ended up not implementing the system tray, so with all unnecessary code removed the program is less than 100 lines of code.
I thought about always showing the process with the highest historical peak memory usage, but that always was a process called Memory Compression (must be some windows internal thing), so not very useful. Overall I'm surprised by how much I learned and how fun this little program was to make. Goes to show that even small contributions to jams can be quite rewarding.

View original message on Discord

&zbiggestprocess My GDI overlay seems to correctly display stats from the process with the biggest memory footprint. Funnily enough its Discord. Not only that, I seem to have discovered that Discord does some wild allocations and deallocations simply from moving the mouse :kekw:

View original message on Discord