You are not logged in.

#1 2009-02-03 08:28:55

arch_nemesis
Member
Registered: 2008-12-19
Posts: 115

Memory management / Memory Leak under KDE 4.2?

If I should do something a little more structured to check this out, I'm open to suggestions.  I'm mostly hoping to confirm or deny this behavior with others.

For context -- I've been using GNOME with Arch on this hardware since mid-December (when I first installed Arch) until last week.  Since then I've been using KDE 4.2.  Prior to Arch, I'd run GNOME under several distros on this same hardware as well.  During all this time I've had conky or some screenlet or whatever indication running to show me RAM usage (like a lot of us do).   It's one of those things that I don't think about much, but notice when it's different than I expect.

I have 3GB RAM, and under GNOME the only time I ever saw it approach or pass 1GB used was when I knew I was doing memory intensive things (VM running + other tasks)

Under GNOME I was seeing about 300-350MB used at startup, or if I'd close down every windowed app or anything I was doing at any given point in time.

KDE 4.2 seems to start up with about 350-450, which is fine.

Here's my issue, and it's confusing to me, possibly due to my lack of understanding regarding memory management.

Over time in KDE 4.2, as reported by conky or various monitoring widgets I've had running, my memory usage will gradually creep up until just about all my RAM is shown as in use.  This doesn't take long, say 1-2 hours.  I also don't have to be doing anything special during that time.  I haven't tested to see if it will creep up with me doing nothing, but I definitely DON'T have to do memory hungry tasks for this to happen.

Interestingly, the KDE system monitor shows a more reasonable amount, usually.  Currently my widget is reporting 2162MB used, with 1640 cached, and the only thing I have open is this firefox window.  (And no, firefox is not using 2GB of RAM)  Checking the system monitor shows no excessive RAM consumption by any process, and .48GB used.   

Now you might think "Just subtract out the cached RAM, which isn't hurting anything, and you get a number that jives with System Monitor."  That's true, but I have two problems with that:

1) Why did I never see anythign like this under GNOME?

2) When my used RAM as shown by the widget gets extremely high like this, I start using *SWAP*.  I can tell you for certain that my swap usage was at zero for all the time I've had this computer prior to using KDE 4.2 these last few days.  Currently I'm using 64MB of swap -- not much, but why am I using any?  And, I know that if I don't reboot soon, that number will also start to grow, though more slowly.

I used to run munin just for fun, maybe I should start doing that again just to get some hard data...

Any ideas?

Last edited by arch_nemesis (2009-02-03 08:30:16)

Offline

#2 2009-02-03 10:31:03

b9anders
Member
Registered: 2007-11-07
Posts: 691

Re: Memory management / Memory Leak under KDE 4.2?

I am sure there is a memory leak in 4.2. I am using 386MB of swap and 867MB of Ram (out of 1gb) according to Htop and all I am running is a few tabs in opera, skype konsole and dolphin. I have had this session running over two days or so though. in 4.1 that would have me at little less than half that. I can't recall ever having used this much swap on this machine tbh(!).

Offline

#3 2009-02-03 11:53:54

Mikko777
Member
From: Suomi, Finland
Registered: 2006-10-30
Posts: 837

Re: Memory management / Memory Leak under KDE 4.2?

Iirc kde 4.1 didn't have nepomuk taking so much ram (working?)...

so nepomuk and preloading are taking my ram here, it seems to settle for 1Gb out of 4 after a while.
I hope its caching / preloading instead of mem leak smile

Offline

#4 2009-02-03 12:36:02

b9anders
Member
Registered: 2007-11-07
Posts: 691

Re: Memory management / Memory Leak under KDE 4.2?

Mikko777 wrote:

I hope its caching / preloading instead of mem leak smile

the kernel caches things just fine. Why would kde start taking up ram for this purpose?

Offline

#5 2009-02-03 13:27:36

b0uncyfr0
Member
Registered: 2008-05-11
Posts: 140

Re: Memory management / Memory Leak under KDE 4.2?

I dont have a memory issue at all. Im actually suprised that its low. I normmaly run Opera with say 5 tabs, dolphin with kmess and ktorrent always in the background. All up its normally just below 600Mb's. I have 4 GB's and a fair bit of plasmoids loading on desktop.

Offline

#6 2009-02-03 13:46:46

arch_nemesis
Member
Registered: 2008-12-19
Posts: 115

Re: Memory management / Memory Leak under KDE 4.2?

I should probably have mentioned that I'm running kdemod and Arch 64.  Are these two things also true for the couple of you who said you haven't seen this problem?

Offline

#7 2009-02-03 21:35:52

whompus
Member
From: Durham. UK
Registered: 2005-08-09
Posts: 256

Re: Memory management / Memory Leak under KDE 4.2?

I had similar issues with swap usage with the same system 3GB ram, kdemod and Arch 64. Have not had a chance to push the system yet but I've had no swap usage after adding the line vm.swappiness=10 to /etc/sysctl.conf.

Offline

#8 2009-02-03 22:34:45

b9anders
Member
Registered: 2007-11-07
Posts: 691

Re: Memory management / Memory Leak under KDE 4.2?

arch_nemesis wrote:

I should probably have mentioned that I'm running kdemod and Arch 64.  Are these two things also true for the couple of you who said you haven't seen this problem?

also running kdemod and arch64 here.

Offline

#9 2009-02-06 07:42:08

abhinandh
Member
Registered: 2008-03-07
Posts: 29

Re: Memory management / Memory Leak under KDE 4.2?

hmm... me too got the same symptoms.

kdemod 4.2 on arch 64
all my 1 gig ram is used up in about 2-3 hrs of uptime and the things get sluggish when swap starts being used!!

Last edited by abhinandh (2009-02-06 07:42:24)

Offline

#10 2009-02-06 08:05:16

damjan
Member
Registered: 2006-05-30
Posts: 451

Re: Memory management / Memory Leak under KDE 4.2?

arch_nemesis wrote:

Interestingly, the KDE system monitor shows a more reasonable amount, usually.  Currently my widget is reporting 2162MB used, with 1640 cached, and the only thing I have open is this firefox window.  (And no, firefox is not using 2GB of RAM)  Checking the system monitor shows no excessive RAM consumption by any process, and .48GB used.   

Now you might think "Just subtract out the cached RAM, which isn't hurting anything, and you get a number that jives with System Monitor."  That's true, but I have two problems with that:

1) Why did I never see anythign like this under GNOME?

KDE .. probably nepomuk .. is touching much more files on the hard disk than GNOME, thus making the kernel cache them (that's good).

64MB of  swap is nothing, the defaults behaviour of the kernel is to swap some very  rare used programs (login perhaps) in order to have more RAM free for cache. The swapiness nob controls the behaviour (http://kerneltrap.org/node/3000).

Summary: you are really only using 480MB ram

Offline

#11 2009-02-06 12:43:53

arch_nemesis
Member
Registered: 2008-12-19
Posts: 115

Re: Memory management / Memory Leak under KDE 4.2?

Thanks for your explanation.  I did disable nepomuk, which had minimal impact on the behavior, but I'm happy to accept your general explanation since it means that I don't need to be concerned.  smile

Offline

#12 2009-02-06 13:19:09

Mikko777
Member
From: Suomi, Finland
Registered: 2006-10-30
Posts: 837

Re: Memory management / Memory Leak under KDE 4.2?

Yup, without composite, nepomuk and strigi...
Running firefox(20tabs), kde, konsole, preload, ktorrent and quassel kde took only 336Mb of ram. (64bit)

That can easily be boosted to the 1gb+ range tho, which ain't necessarily bad like the previous poster said.

Offline

Board footer

Powered by FluxBB