|
|
Subscribe / Log in / New account

Memory leaks in managed languages

Memory leaks in managed languages

Posted May 3, 2009 4:41 UTC (Sun) by sbergman27 (guest, #10767)
In reply to: Memory leaks in managed languages by JoeBuck
Parent article: Tomboy, Gnote, and the limits of forks

"""
the virtual memory size for gnote rises to 110m with ten notes displayed
"""

Virtual memory size? That's completely useless. What is the RSS size? (Strictly speaking you should turn off swap to take that measurement, but if you have plenty of memory it shouldn't make much, if any, difference.

Just for reference, the virtual memory size for Tomboy starts out at 343M and increases to 439M with 10 notes.


to post comments

Memory leaks in managed languages

Posted May 3, 2009 6:10 UTC (Sun) by JoeBuck (subscriber, #2330) [Link] (5 responses)

I get 53M for RSS with ten notes displayed.

Memory leaks in managed languages

Posted May 3, 2009 12:55 UTC (Sun) by sbergman27 (guest, #10767) [Link] (4 responses)

So about half of what Tomboy uses in that scenario. You may already know all this, but RSS tells us how much actual physical ram is being used by the process. Virtual (and someone please correct me if I am inaccurate) is just how much memory the process has requested. Since Linux does lazy allocation of memory, and most apps don't actually touch nearly as much memory as they request, the virtual number is pretty meaningless. If you sort by size, descending, and then start adding up the virtual column, you'll likely quickly reach a point where total virtual far exceeds the sum of your ram and swap. It's pretty much a fiction.

To get the "real" unique memory usage for the process, you can (with the swap turned off) subtract the shared column from the rss column. The smem utility, featured a few days ago here on LWN, can show other interesting things, like proportional set size.

Sometimes I think that the authors of "top" had a special conference to determine how to present memory information in the most misleading way possible, and then wrote "top" based upon the results. Many people do think that the virtual size actually means something. And most new users seem to think that Linux is a sort of monster black hole of memory leakage, since no matter what they are doing, it sucks up all available memory until there is almost no free memory left. Htop is, at least, better.

Memory leaks in managed languages

Posted May 3, 2009 17:12 UTC (Sun) by hppnq (guest, #14462) [Link] (3 responses)

The virtual memory usage as reported by top and ps includes shared libraries, among other things, which is why the numbers do not add up to a necessarily meaningful number. No conspiracy here. ;-)

Accounting memory usage

Posted May 3, 2009 18:38 UTC (Sun) by arjan (subscriber, #36785) [Link] (2 responses)

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

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 © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds