LWN.net Logo

Accounting memory usage

Accounting memory usage

Posted May 3, 2009 18:38 UTC (Sun) by arjan (subscriber, #36785)
In reply to: Memory leaks in managed languages by hppnq
Parent article: Tomboy, Gnote, and the limits of forks

http://repo.moblin.org/moblin/development/core/source/mem...

memuse is a small simple app that does a reasonably good job of showing the "real" memory cost of an application; it accounts the cost of a shared library as divided by the number of users etc etc....


(Log in to post comments)

Accounting memory usage

Posted May 4, 2009 8:13 UTC (Mon) by nhippi (subscriber, #34640) [Link]

After finding out howto rescue this from a .src.rpm and build it, some comments. Per app memory consumption appears to be effectively:

awk '/Pss:/{sum+=$2}END{print sum "kB"}' /proc/$pid/smaps

This makes one wonder why ps/top doesn't support showing Pss themself.

The library section of output appears to be quite short, not showing for example libc or libX11.

Accounting memory usage

Posted May 10, 2009 23:26 UTC (Sun) by vonbrand (subscriber, #4458) [Link]

Trouble with that idea is that it depends sensitively on the other stuff that is running at the moment. E.g., having no or 20 processes also using glibc at the moment makes quite a difference "on average".

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds