Click to See Complete Forum and Search --> : memory leak?
Tyr-7BE
03-27-2001, 12:38 PM
I just upgraded to kernel 2.4.2, and I'm very happy with it except for one detail. When I go to sleep at night, I have 145 megs of RAM free according to Gkrellm. When I wake up, I have 89 megs free. I took a look at GTop, and according to its procs I'm only using a miniscule amount of memory. The biggest mem hog is X at a whopping 4.5 megs. If this is correct, I should still have 145 free (I have 192 total). Anyone know what could be causing this leak?
cage47
03-27-2001, 01:04 PM
Someone might have a more detailed description but I read somewhere that X has a hard time releaseing resources, so leaving X running can seem to use up resources.
Tyr-7BE
03-27-2001, 01:24 PM
Is that only under 2.4.2? Cause when I left it overnight with 2.2.18pre21, it was still kickin in the morning.
cage47
03-27-2001, 01:32 PM
forgive me for not remembering where exactly it was but I read it online (Maybe in alt.os.linux) back around December so I don't think it's 2.4 specific. I was reading about networking at the time and it was in reference to having X on a dedicated server chewing up resources until x was reset. Comon someone back me up on this one. But since you saw it happen there you go.
bdg1983
03-27-2001, 02:32 PM
Linux does allocate unused memory for caching etc. and releases the memory when needed for applications.
Tyr-7BE
03-29-2001, 03:05 PM
Originally posted by mdwatts:
Linux does allocate unused memory for caching etc. and releases the memory when needed for applications.
Forgive me if I sound like a stupid newbie here, but here's what happened. When I was using kernel 2.2.18pre21, my memory was just fine and dandy...I'd check gkrellm before going to sleep and it would be around 140 Megs, and when I got back up in the morning it would still be 140 megs. Now I've upgraded to 2.4.2...I checked gkrellm before I went to bed last night: 160 megs of free mem. I checked it when I woke up this morning: 60 free megs of ram. I opened up GTop, and according to what I see there, there shouldn't be more than 40 megs in use (the 160 megs scenario). 100 megs has gone somewhere...are you saying that it's been cached somewhere? Is this a new 2.4 feature?
MBMarduk
03-29-2001, 03:59 PM
There could be a LOT of variables to take into account figuring this out. It COULD be a simple app. (ask other 2.4.2 users for example.)
It could be some option you turned on/off compared to the 2.2.18 Debian kernel.
Or -OK- *IF* it's kernel proper, check the kernel mailing lists to see if there's any mention of something similar.
Try making an "oldconfig" with an older kernel: 2.4.1 or 0 (or even the NEWER 2.2.19)
Good luck
-Mike
bdg1983
03-29-2001, 06:52 PM
I was just saying that Linux utilizes available memory for it's own use.
And MBMarduk beat me to it once again with his explaination.
Bradmont
03-29-2001, 10:48 PM
Originally posted by Tyr-7BE:
Forgive me if I sound like a stupid newbie here, but here's what happened. When I was using kernel 2.2.18pre21, my memory was just fine and dandy...I'd check gkrellm before going to sleep and it would be around 140 Megs, and when I got back up in the morning it would still be 140 megs. Now I've upgraded to 2.4.2...I checked gkrellm before I went to bed last night: 160 megs of free mem. I checked it when I woke up this morning: 60 free megs of ram. I opened up GTop, and according to what I see there, there shouldn't be more than 40 megs in use (the 160 megs scenario). 100 megs has gone somewhere...are you saying that it's been cached somewhere? Is this a new 2.4 feature?
I'm running 2.4.2, and havn't had any problems (Though I don't generally pay attention to mem usage... I have 384 megs 'o ram, and I [almost] never leave X running for any extended amount of time). It may also just be that 2.4.2 is caching more than 2.2.18p21.
Tyr-7BE
03-30-2001, 10:42 PM
hrmmm..it DOES seem to level off around 50 megs...doesn't get any higher or lower. And upgrading to 2.4.3 didn't do anything :(
Tyr-7BE
03-30-2001, 10:59 PM
Alright...all this cacheing stuff...I wasn't aware of it. It's taking free memory and it's caching it. Where, and why? Why not just leave it free to use? Can anyone point me to some good documentation on the subject?
Bradmont
03-31-2001, 04:34 AM
Originally posted by Tyr-7BE:
Alright...all this cacheing stuff...I wasn't aware of it. It's taking free memory and it's caching it. Where, and why? Why not just leave it free to use? Can anyone point me to some good documentation on the subject?
The main reason for caching stuff into ram is to allow that stuff (usually the more commonly used stuff) to be accessed faster. When the OS can predict what you are likely to use and pre-load it into memory, then when you go to use that resource, it's bleedin' fast. If, however, too much memory is being used with caching, and you try to do something that requires a significant amount, the cached stuff will just be tossed... it's really all done to improve system responsiveness.
AmiHughes
04-02-2001, 05:17 PM
My posting rights have been revoked because I tend to do irrational things.
[ 03 April 2001: Message edited by: Sensei ]
sandy0
04-02-2001, 11:11 PM
"Memory caching"??? "memory leaks"??? Sounds like a Windoze thing! ;) Guess that's what happens when you go the GUI route. BTW, what does the "Derek post" have to do with the topic at hand and what's the big deal about ratings?
The King Ant
04-03-2001, 11:43 PM
First off, I seriously doubt that your kernel is using up a whole bunch of memory, or that there is some kind of leak. If there was something that serious (which is incredibly unlikely in a stable kernel release) you would have heard about it. Or somebody would have.
Secondly, unless you are running a development or possibly really really old verison of Xwindows, it is probably not leaking memory. I've had X running for 60 or so days without problems.
Linux tends to utilize all of it's memory for caching and what not, but if something needs some more RAM, it'll usually just cache less rather than going into swap space. With top, look at how much swap spaces is being used (it's just below "Mem" at the top of the screen).
If lots of your swap space is being used, try killing x windows and then running top from a terminal and see if you're using less swap.
Tyr-7BE
04-04-2001, 12:40 AM
My swap is still going strong...virtually untouched. I'm beginning to think that it's just caching more. For example, I run both genome@home (http://gah.stanford.edu/) and folding@home (http://foldingathome.stanford.edu/) and when I turn those off the problem is a lot less severe...it still gradually loses mem, but it's not as bad.