Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xscreensaver memory leak
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Apreche
Guru
Guru


Joined: 18 Sep 2003
Posts: 506
Location: Beacon, NY

PostPosted: Wed Mar 24, 2004 4:12 pm    Post subject: xscreensaver memory leak Reply with quote

I think there is a memory leak in xscreensaver. Here's the story. I have gkrellm2 running all the time to watch what my pc is doing. I run xscreensaver all night, because this is my computer at work. When I come back in the morning a bunch of RAM has filled up. I do ps -aux to list all the processes and how much ram they are taking up, but nobody seems to be the culprit. The ram might be 75% full as reported by gkrellm, but the total % listed there will be < 10%.

I think this is what the problem is. I am using the Nfornce Integrated Graphics card. This means that my system memory is my video card memory. I have 512 total, and in the BIOS I have set 64MB to be the max to be used by the video card. What I think is happening though is this. I have the screensavers running on random mode and every so often it switches which screensaver is running. I'm running them all using hardware opengl accelleration and I'm using nvidia-kernel and nvidia-glx, the newest versions with a properly configured 2.6 kernel. (all nforce options enabled). What I think happens is that each screensaver takes up a bit of the ram when it loads because it is also the video card ram. Then when the screensavers switch the memory isn't being set free. And obviously the limit I set in the BIOS is being ignored.

I'm not 100% sure that this is the cause of the problem, but it seems reasonable. During the day my memory use doesn't increase unless I run more applications. The only difference between day and night is that xscreensaver runs all night.

Has anyone else had a problem like this? Any known solutions? Anyone who can verify my guess as being right or wrong? Right now the only way I have of freeing up the memory is restarting the pc, not something I like doing. Thanks.
Back to top
View user's profile Send private message
Epyon
l33t
l33t


Joined: 11 Sep 2003
Posts: 754
Location: NJ, USA

PostPosted: Wed Mar 24, 2004 4:41 pm    Post subject: Reply with quote

If I leave my computer on overnight it'll do the same thing. At midnight slocate and updatedb run. They make the ram usage go really high. It's never a problem though since the memory does eventually get reclaimed if something needs it.
Back to top
View user's profile Send private message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Wed Mar 24, 2004 4:43 pm    Post subject: Reply with quote

This may sound like a smart-alec answer, but one obvious way you can determine if xscreensaver is the culprit is simply not run xscreensaver for one night. You can also try killing the xscreensaver daemon and see if that frees up the memory.

I don't think xscreensaver relies entirely on video memory to run, and if a leak is somewhere in the code that runs in system memory, then of course it won't be the 64MB of video memory that gets eaten away.

If not running xscreensaver (or killing it) seems to plug the leak, you can start tweaking xscreensaver's configuration to try and pinpoint the leak. Maybe not run the 3D accelerated modules, or not switch modules as often (or at all), etc. Also check Gentoo's Bugzilla and whatever passes for xscreensaver's bugs/known-issues database to see if the developers are already aware of any leaks.
_________________
Proud to be a... eh, forget it.

"Everyday is just one day." -- not the Traveling Wilburys
Back to top
View user's profile Send private message
Apreche
Guru
Guru


Joined: 18 Sep 2003
Posts: 506
Location: Beacon, NY

PostPosted: Thu Mar 25, 2004 1:30 pm    Post subject: Reply with quote

I disabled xscreensaver last night, so my theory was incorrect. The memory still leaked. I think updatedb and slocate are the culprits as epyon suggested. Since the memory is reclaimed it is no big deal. I was just wondering if there was some program I could run/emerge that would clear it out of ram immediately. I need to watch the ram for software development purposes.
Back to top
View user's profile Send private message
sapphirecat
Guru
Guru


Joined: 15 Jan 2003
Posts: 376

PostPosted: Thu Mar 25, 2004 4:15 pm    Post subject: Reply with quote

Apreche wrote:
I think updatedb and slocate are the culprits as epyon suggested.

My guess too. Have a look at "free -m" and see if there's a ton of memory listed under buffers/cache some morning. If so, that pretty well confirms it.
Quote:
I was just wondering if there was some program I could run/emerge that would clear it out of ram immediately. I need to watch the ram for software development purposes.

I have a stupid little C program around that I was using once to stress CPU/RAM; as a side effect, it pressures the disk cache into letting go of its memory. I could email/PM it to you if you wanted.

If you're doing memory debugging, you might want to look into tools like efence or valgrind.
_________________
Former Gentoo user; switched to Kubuntu 7.04 when I got sick of waiting on gcc. Chance of thread necro if you reply now approaching 100%...
Back to top
View user's profile Send private message
Apreche
Guru
Guru


Joined: 18 Sep 2003
Posts: 506
Location: Beacon, NY

PostPosted: Thu Mar 25, 2004 11:32 pm    Post subject: Reply with quote

I just manually ran locate -u after a reboot and the ram filled right up to the exact amount as before. There is no question about it. I've got it all cleared out though, so it's all good. It's a cheap hack, but if I allocate and free a few hundred megs it cleans right out because the memory that locate took up is the first to get allocated. Small C program it was yes. Thanks all, sorry xscreensaver for my false accusation.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum