[plug] Possible problem with memory leaks
Bret Busby
bret at busby.net
Mon Feb 28 01:26:09 WST 2005
On Tue, 22 Feb 2005, Bret Busby wrote:
> On Mon, 21 Feb 2005, Brad Campbell wrote:
>
>>
>> Bret Busby wrote:
>>>
>>> Output of free:
>>>
>>> total used free shared buffers cached
>>> Mem: 762936 575960 186976 0 59240 323376
>>> -/+ buffers/cache: 193344 569592
>>> Swap: 1052216 0 1052216
>>>
>>
>> So you are actually using about 193M out of 768. Sounds pretty reasonable
>> to me.
>> You have 323M Cached and 59M Buffers. If the system really needs the memory
>> it will dump cache. You have 186M completely free. No problem.
>>
>> Here are a couple of outputs from my machines for comparison. You can see
>> my laptop has 20M free, but 570M cached. If it needs the memory back it
>> will just reclaim it by dumping cache.
>>
>> bklaptop:~>free -m
>> total used free shared buffers cached
>> Mem: 1009 988 20 0 51 570
>> -/+ buffers/cache: 366 642
>> Swap: 980 477 502
>>
>> brad at tv:~$ free -m
>> total used free shared buffers cached
>> Mem: 1515 1480 35 0 0 1104
>> -/+ buffers/cache: 375 1140
>> Swap: 0 0 0
>>
>> brad at srv:~$ free -m
>> total used free shared buffers cached
>> Mem: 1518 1405 112 0 61 995
>> -/+ buffers/cache: 348 1169
>> Swap: 964 26 938
>>
>> Here are the major memory consumers on bklaptop as reported by top sorted
>> by memory.
>>
>> 1513 brad 19 0 181m 130m 24m S 2.0 13.0 16:29.33 thunderbird-bin
>> 1515 brad 8 0 181m 130m 24m S 0.0 13.0 0:00.03 thunderbird-bin
>> 1516 brad 9 0 181m 130m 24m S 0.0 13.0 0:00.99 thunderbird-bin
>> 1518 brad 9 0 181m 130m 24m S 0.0 13.0 0:02.35 thunderbird-bin
>> 2566 brad 10 0 90552 81m 16m S 0.3 8.1 14:33.48 firefox-bin
>> 2568 brad 8 0 90552 81m 16m S 0.0 8.1 0:00.00 firefox-bin
>> 2569 brad 9 0 90552 81m 16m S 0.0 8.1 0:04.46 firefox-bin
>> 2571 brad 9 0 90552 81m 16m S 0.0 8.1 0:06.05 firefox-bin
>> 3280 brad 8 0 90552 81m 16m S 0.0 8.1 0:00.00 firefox-bin
>> 7807 brad 8 0 42128 41m 964 S 0.0 4.1 0:09.14 bk
>> 5157 brad 8 0 42116 41m 964 S 0.0 4.1 0:12.77 bk
>> 1480 root 9 -10 69540 30m 9636 S 0.7 3.0 29:58.28 XFree86
>> 3995 brad 9 0 20016 19m 19m S 0.0 1.9 1:37.89 dosexec
>> 3997 brad 9 0 20428 12m 11m S 0.0 1.2 0:09.72 xcrt
>> 3796 brad 9 0 11632 11m 11m S 0.0 1.1 0:06.89 dosexec
>> 7674 brad 9 0 11304 11m 3440 S 0.0 1.1 0:04.48 wish
>>
>> Your system looks fine.
>> HTH.
>> Brad
>> --
>>
>
> After that, I kept going, and tried to use up the available RAM. With 19
> Mozilla browser windows open, with an average of about 7-8 tabs in each
> window, open, I got up to about 80% memory usage. I then quit Mozilla, and
> that changed the memory being used (as opposed to being cached), from about
> 500MB, to about 200MB, with an increase in the cached memory, of about 300MB.
>
> I then cleared the cache, and changed the Cache setting, in Mozilla, from
> 50MB to 5MB, as I figured that the amount of the cache, as set, would apply
> to each browser window, and so that I would not get anywhere as much memory
> caching.
>
> I then again quit Mozilla, and restarted it, but the memory usage was
> unchanged.
>
> This morning, with three Mozilla browser windows open, with a total of 28
> tabs open, one Konqueror window with 6 tabs open, and three xterm sessions,
> two with just command prompts (one in an ssh session) and one with PINE
> running, I have 100% memory usage, with 37% in cache.
>
<snip>
>
> It seems to me to be using too much memory, for what is running, and, whilst
> the second data line of the free command, shows 408MB to be used as cached
> (if I read that correctly), the first line of the data output for that, shows
> only 23MB as free, and 284MB as cached, which is less than either of the
> numbers on the second line.
>
> An issue here, is that the memory usage appears to have increased since
> yesterday, when I was running a higher load, in terms of open browser windows
> and tabs, and, in a previous session when I had similar memory usage
> displayed, when I tried to load open office, it gutted itself and had to be
> re-installed. I had assumed that that was due to memory overload.
>
> I do not know whether it was a similar scenario when I was previously running
> Konqueror, and in the process of an operation using Konqueror, the system
> committed suicide and had to be re-installed (re-install of Debian Sarge, not
> just an application). At that time, when Konqeruor went awry, and I went to a
> text console (<CTRL><ALT><Fx>), I got continuous scrolling of a line stating
> that the ext3 journalling was failing. I had to try to go to a text console
> that way, as I ccould not get an xterm window to open, in X-Windows, at that
> time. There was no login prompt displayed, just that line of scrolling text.
> Then, the system progressively chopped itself up from the inside, and in the
> end, would not boot. That was in the last couple of weeks.
>
> A problem with all of this, is that it appears that, in running Debian Sarge,
> and/or, in using Mozilla, the proposition of being able to leave a Linux box
> running indefinitely, relative to the famous "run Windows 9x for 29 days, and
> it is guaranteed to have a system crash", does not appear to be valid, as it
> appears that I cannot run Debian Sarge as a workstation, for more than a few
> hours, or, maybe, even up to a day, without needing to reboot it, to free up
> memory.
>
> And, I am concerned that reinstalling the operating system may become
> something like a weekly or monthly requirement.
>
> I am not trying to go into trolling - I believe that I have a problem, with
> memory not being properly released, and it appears to make Debian Sarge,
> unstable, when Debian Sarge is used as a workstation.
>
> I assume that Debian Sarge does not have a utility that can be run, that
> frees up memory that is not being directly used by running applications and
> running utilities?
>
> For the problems involved, I think it would be better to not have the memory
> caching, as the instability is more of a sacrifice than the benefit of faster
> loading of applications via caching, that has been mentioned as the reason
> for the cached memory. I am assuming that it is that the memory allocated for
> caching, is what is taking up all of the memory that is used, that is not
> directly used by running applications and utilities.
>
> --
>
The system ran out of memory and crashed again on Sunday morning.
The memory usage appeared a bit high, so after Mozilla crashed, I tried
to close Konqueror, and the Load Average kept increasing, and the system
hung when I tried to close Konqueror, so I had to reboot the system.
The only thing that I can think of, that is causing this, is that memory
is not being properly freed, when an application such as a browser
window, is closed.
--
Bret Busby
Armadale
West Australia
..............
"So once you do know what the question actually is,
you'll know what the answer means."
- Deep Thought,
Chapter 28 of
"The Hitchhiker's Guide to the Galaxy:
A Trilogy In Four Parts",
written by Douglas Adams,
published by Pan Books, 1992
....................................................
More information about the plug
mailing list