[GRLUG] memory leak?

Adam Tauno Williams awilliam at whitemice.org
Thu Nov 19 10:32:27 EST 2015


On Wed, 2015-11-18 at 21:57 -0500, Eric Beversluis wrote:
> The curious thing is that as I close programs, the swap doesn't seem
> to go down and it's not clear whether the computer runs any faster.

Modern memory management doesn't work that way.  Memory is not freed
until it is needed; why go through the free-ing process?  That just
eats cycles.

FYI, on this topic the Internet, via search engines, are not your
friends.  The great majority of posts on this topic are simply
incorrect - most people do not understand how memory management works.
 BEWARE THE INTERWEBZ PONTIFICATOR, he is an idiot.

This is a nice introduction - http://virtualthreads.blogspot.com/2006/0
2/understanding-memory-usage-on-linux.html

LWN has also done a nice series - http://lwn.net/Articles/250967/

Modern memory management is complicated;  saying X-is-using-Y is in
almost all cases a gross over simplification.

> I see most of the slowness in Thunderbird, I think. Is this what we
> used to call 'memory leak' and accuse Windows of? 

Depends,  high memory use is not necessarily a leak.

What happens if you "$ sudo swapoff -a" [disable swap] before you start
working?

You can ask the kernel to drop all of its caches, which likely will
release memory.  A useful trick for testing.

echo 3 | sudo tee /proc/sys/vm/drop_caches


-- 
Adam Tauno Williams <mailto:awilliam at whitemice.org> GPG D95ED383
Systems Administrator, Python Developer, LPI / NCLA




More information about the grlug mailing list