Memory leaks in managed languages
Memory leaks in managed languages
Posted May 3, 2009 4:07 UTC (Sun) by JoeBuck (subscriber, #2330)In reply to: Memory leaks in managed languages by sbergman27
Parent article: Tomboy, Gnote, and the limits of forks
It looks quite similar; as reported by top, the virtual memory size for gnote rises to 110m with ten notes displayed. My guess is that the memory is mostly used by the gtk+ objects, which are probably just the same for the two programs.
The leaks I mentioned don't seem to be very large.
By contrast, an instance of Emacs visiting ten files is only 18m. Yet people still claim that Emacs is a bloated program.
      Posted May 3, 2009 4:41 UTC (Sun)
                               by sbergman27 (guest, #10767)
                              [Link] (6 responses)
       
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. 
 
     
    
      Posted May 3, 2009 6:10 UTC (Sun)
                               by JoeBuck (subscriber, #2330)
                              [Link] (5 responses)
       
     
    
      Posted May 3, 2009 12:55 UTC (Sun)
                               by sbergman27 (guest, #10767)
                              [Link] (4 responses)
       
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. 
     
    
      Posted May 3, 2009 17:12 UTC (Sun)
                               by hppnq (guest, #14462)
                              [Link] (3 responses)
       
     
    
      Posted May 3, 2009 18:38 UTC (Sun)
                               by arjan (subscriber, #36785)
                              [Link] (2 responses)
       
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.... 
 
     
    
      Posted May 4, 2009 8:13 UTC (Mon)
                               by nhippi (subscriber, #34640)
                              [Link] 
       
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.  
     
      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  
     
      Posted May 4, 2009 4:19 UTC (Mon)
                               by jordanb (guest, #45668)
                              [Link] 
       
That may pose some sort of correlation to Wirth's Law: if you software is considered bloated, all you have to do is wait a bit and someone will come along and blow you away by an order of magnitude. 
     
    Memory leaks in managed languages
      
the virtual memory size for gnote rises to 110m with ten notes displayed
"""
      I get 53M for RSS with ten notes displayed.
      
          Memory leaks in managed languages
      Memory leaks in managed languages
      
      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. ;-)
      
          Memory leaks in managed languages
      Accounting memory usage
      
Accounting memory usage
      
Accounting memory usage
      glibc at the moment makes quite a difference "on average".
      
          Memory leaks in managed languages
      
 
           