Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to Measure the Working Set Size on Linux (brendangregg.com)
133 points by ingve on Jan 17, 2018 | hide | past | favorite | 8 comments


Kinda 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


The 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?


Ah, 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).


Some 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.


Calculating scale limits or resource requirements for a given scale.


There is also ps_mem.py: https://github.com/pixelb/ps_mem

"A utility to accurately report the core memory usage for a program."


That'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.


See also treetop, which shows accurate memory usage for a process tree: https://github.com/turbo/treetop




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: