0

How do you measure the memory footprint of a set of forked processes?

view story
linux-howto

http://serverfault.com – Say I've got a process using 200MB of memory, and it fork()s: python -c "import os; data='x'*200000000; os.fork(); raw_input()" Programs like 'top' will show each process using 200MB, with very little SHRd memory, so it appears as if the processes are using 400MB in total. However, because fork() implements copy-on-write (COW) for the process's memory pages, the reality is that the processes are only using 200MB in total. Why doesn't top show what fraction of the memory is COW? Is there a way to make it do so? Or is there another command I can use instead? Note: 'top' on OSX seems to ha (HowTos)