memplot icon indicating copy to clipboard operation
memplot copied to clipboard

Not detecting full process memory?

Open Adreitz opened this issue 2 years ago • 2 comments

I found this project when trying to find an automated solution for reporting the maximum memory of a process. I got it running, but the values memplot reports don't match Activity Monitor. I am trying to monitor python running Stable Diffusion, which uses a lot of memory at high resolutions. When Activity Monitor reported ~35-38 GB used, memplot only ~2.8 GB. The variation in memory use over time also did not match the values reported by Activity Monitor. Is it possible this has something to do with the unified memory structure if Activity Monitor reports full memory use but memplot might ignore the portion used by the GPU?

Thanks!

MacBook Pro M2 Max 64GB MacOS 13.4b2

[Edit] By the way, I think it might be a good addition for memplot to be able to report, numerically, the max, avg, and min memory usage (and maybe the timestamps of the max and min). Maybe also find a way of filtering the data so that the min memory reporting ignores the shutdown sequence of the process if it terminates during monitoring.

Also, I think the MacOS binary for Apple Silicon should be suffixed "arm64", not "amd64". [/Edit]

Adreitz avatar Apr 17 '23 01:04 Adreitz

Memplot is not tracking GPU memory!

0x0f0f0f avatar Apr 18 '23 16:04 0x0f0f0f

Okay, just keep in mind that Apple Silicon Macs no longer differentiate between RAM and VRAM -- it's all the same, just used by processes for different things.

After some searching around and testing myself, I found that the "footprint" command line program generates data that seems to be what I want to see and can be programmed to poll at a desired rate. Piped to awk to pick out just the number I want and then redirected to a file, I can then generate a record of memory use over time.

Adreitz avatar Apr 18 '23 21:04 Adreitz