[lkml]   [2005]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectHow do you accurately determine a process' RAM usage?
I wrote a tool to report how much RAM a
particular program (apache for e.g.) was using:

I was then pointed at the following:
which describes how copy-on-write pages are
not counted as shared since 2.6.

So how can one determine how much RAM a process is using?
Seems like a fundamental requirement to me.
Could we add a "SharedTotal" column to /proc/$$/statm for e.g. ?

Here's a little python script to demo the problem:

import os, sys, time
a="\x00"*(32*1024*1024) #alloc 32MiB
if(not pid):
print "only %.1f%% reported as shared" % ((sizel[1]/sizel[0])*100)
Pádraig Brady -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-07-07 00:18    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean