3 ms·
How to Measure the Working Set Size on Linux
- eikenberry 9y agoThe article mainly presents the tools the author uses to measure WSS and while I can see a few possibilities I'm curious if anyone can give some more examples of where measuring WSS would be useful?
- virtuabhi 9y agoSome scenarios come to mind - (1) help decide the memory allocated to the program to avoid IO (2) select the best page replacement policy (3) select the appropriate degree of multiprogramming.
- donaldihunter 9y agoCalculating scale limits or resource requirements for a given scale.
- brendangregg 9y agoAh, I should have mentioned why I was doing this: it's part of Linux KPTI patch analysis (Meltdown) that I've been doing, as the WSS is one factor in the performance loss experienced (due to TLB flushing).
- zokier 9y agoKinda sidenote, but I find it funny how an simple innocent question like "how much memory does app x use" has no easy answers. This is further complicated when the application in question runs in multiple processes
- ashayh 9y agoThere is also ps_mem.py: https://github.com/pixelb/ps_mem https://github.com/pixelb/ps_mem "A utility to accurately report the core memory usage for a program."
- brendangregg 9y agoThat's not measuring working set size. It's showing usage in terms resident memory, as you see in many tools (by process, not by program). But you don't know how much of that memory is active or is cold. That's what WSS measures: active memory.
- minxomat 9y agoSee also treetop, which shows accurate memory usage for a process tree: https://github.com/turbo/treetop https://github.com/turbo/treetop