Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Tip 'o the Day: discovering the real memory usage of aprocess



ps -lyu <your_username>

By default, top(1) shows the virtual and resident memory sizes of
processes, which is a little misleading, in that shared libraries are
counted over and over again, painting a scarier picture of memory
usage than the actual situation. Thanks to a comment attached to a
very useful entry[1] in a very useful blog[2], I discovered the above
invocation of ps(1), which will list, in the "SZ" column, the size of
the process itself, discounting shared libraries and such.

For more details on all of this, see the blog entry itself: [1].

For more details on what ps(1)'s "SZ" column is really representing,
search the manpage for '^size':

size       SZ       approximate amount of swap space that would be required if
                    the process were to dirty all writable pages and then be
                    swapped out. This number is very rough!

Cheers,
Josh

[1] http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html
[2] http://virtualthreads.blogspot.com/

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links