Clear the computer's memory?
Alan McKinnon
alan at linuxholdings.co.za
Thu Mar 30 13:42:34 UTC 2006
On Thursday 30 March 2006 09:47, Daniel Carrera wrote:
> Michael V. De Palatis wrote:
> > Yes, of course Firefox. Firefox is probably the WORST application
> > used on a day to day basis in terms of memory wastage. I've
> > stopped using it for that very reason.
>
> Yes. I don't understand how closing Firefox can give me back 200MB
> of RAM! That doesn't make sense at all. Firefox itself is what,
> 5MB? All I can guess is that it stores every page I visit in
> memory, which is stupid.
The binary does take up 5M, then it loads in all the plug-ins, and the
extensions, then builds massive data structures in memory so it can
parse the HTML, then still caches everything in sight. That's the
default - there are settings in about:config to change this
bahaviour. Mozilla released a statement recently about this, it
should be on their web site.
<snip>
> You know what would be nice, if there was a tool that told me how
> much memory an application is using. Yes, I know about 'top', but
> after reading the man pages I can't figure out how to sort the
> processes according to how much memory they take. There used to be
> an application called 'gtop' (Gtk top) which was really good. I'm
> not usually into GUI stuff when the CLI will do, but this was a
> case where I thought the GUI was worth it.
top lies. ps also lies.
The reason is shared memory and libs. Firefox uses a bazillion libs
and they add up to a gazillion bytes. But many other apps use the
same libs so the output of top and ps is misleading.
When you shut down Firefox, it will go away and the kernel does a good
job of reclaiming that memory. Not necessarily all at once either,
but if it needs that 50M that isn't actually in use anymore, then it
gets reclaimed. If you know Java, the parallels with the garbage
collector are striking.
And, the kernel grabs most of the remaining RAM for disk buffers and
caches just in case it needs them. These can be flushed and reclaimed
quickly if an app needs memory.
Hence the oddity of a 1G machine sitting there doing nothing and 99%
of memory apparently in use.
--
Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five
More information about the ubuntu-users
mailing list