LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Memory usage using TOP (http://www.linuxquestions.org/questions/linux-newbie-8/memory-usage-using-top-625865/)

FantaJ 03-05-2008 06:22 AM

Memory usage using TOP
 
I'm running an app where I know the memory the app is using is increasing and I can see it growing with TOP (VIRT and RES). I then know the app has no need of the memory (it's stopped doing the heavy work) but I see from TOP that the app has not released the memory.

The app is still running but does it not release the memory until another app needs it? Any insight be great, thanks!

I'm using Ubuntu on: Linux computer 2.6.20-16-generic #2 SMP Fri Aug 31 00:55:27 UTC 2007 i686 GNU/Linux

H_TeXMeX_H 03-05-2008 11:35 AM

This means the app probably has a memory leak. If you kill the app, the memory it was using will probably be reclaimed. If you're the developer of this app, fix it, if not, then mention this to the developers and have them look into it. Of course, if this happens to be a big, bloated KDE app or something like Open Office, then this is just a fact of life. These programs are bloated and leaky.

johnsfine 03-05-2008 12:35 PM

Quote:

Originally Posted by FantaJ (Post 3078770)
I can see it growing with TOP (VIRT and RES).

Quote:

The app is still running but does it not release the memory until another app needs it?
Which do you expect it to release: virtual or physical?

If the app is done with the data objects taking up the virtual memory and has correctly released those data objects, it is still a complex process to get the virtual memory released and even without any memory leak there may be no significant release of virtual memory without the app exiting.

If the app does release any virtual memory, then necessarily the OS will take back the associated physical memory. Other than that, the app has no way to release physical memory.

If the app is holding on to dead virtual memory that it isn't actually using, it is normal and correct for the OS to swap that out only when some other task wants some memory.


All times are GMT -5. The time now is 10:56 AM.