[kwlug-disc] Debugging for memory use

Khalid Baheyeldin kb at 2bits.com
Mon Aug 30 11:53:37 EDT 2010


On Mon, Aug 30, 2010 at 11:27 AM, Chris Irwin <chris at chrisirwin.ca> wrote:

> Short question: How do I find out why nautilus is using so much
> memory, and maybe fix it. I'm somewhat of a rookie when it comes to
> debugging applications, but I have some C ability, and wouldn't mind
> investing the time to fix my issue.
>
> Long explanation: I've been having a problem where over time my
> machine has less and less free memory. After some playing around, it
> turns out that about 500MB of 'stuff' had been swapped out.


Check if a lower vm.swappiness helps?

http://www.linuxvox.com/2009/10/what-is-the-linux-kernel-parameter-vm-swappiness/


> I have 4GB of ram, and `free -m` showed very little as 'cached' (maybe
> 100MB), so I'm looking at 'actual' memory usage.
>
> First thing I did was kill chromium. For a browser, it tends to be
> rather memory intensive.


Because each window (rather each tab) in the browser is a separate process.
That is one of the design goals for Chromium, to isolate a bad plugin
(Flash) taking down the entire browser and all its windows/tabs.

So, if you open a lot of tabs, that means lots of processes.


> That only freed up a few hundred MB of
> memory. My machine, sitting at an empty Gnome desktop was using ~3.2
> GB doing nothing.


This is insane.


> After some detective work I killed nautilus and
> suddenly had an extra 1 GB of memory available. This has happened
> twice so far, but the effects are far enough removed from any actual
> nautilus use that I don't know what caused it.
>

Even 2.2 GB with nothing but Gnome is still too high.

I am using KDE, so can't tell what is normal for Gnome, but looking at my
laptop now, using the RES field in top: Firefox is the one that uses most
memory (1.1G, yes many tabs open), then Xorg is 188MB, then Amarok is 145MB,
and Open Office with one document being edited is 104MB. Everything after
that is less than 100MB.

So, how can I investigate this? Can I install symbols and connect to a
> running nautilus process with gdb? Also, how do I use gdb? Is there
> something else that is better suited for debugging memory issues?
>

Does Nautilus do something like automatic desktop indexing, or something
like that? That would consume a lot of memory and if there is a bug, it can
be leaking memory too.
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20100830/a57ff5a1/attachment.htm>


More information about the kwlug-disc mailing list