Garl R. Grigsby wrote:

> In the last several weeks, I have noticed that the OS does not seem to
> be releasing memory correctly. The machine is a dual Pentium Pro 200
> with 196 MB. I was working on the box one day and I noticed that the
> drive seemed to be running a lot. Most of what I do on the system does
> not access the disk much. It mostly runs a couple of different Java
> apps. So I began to investigate and found (through top) that all of the
> system memory was tied up and the machine was swapping like crazy. So I
> shut all of the apps down and checked the memory again. It was still
> running heavily  in swap, but nothing appeared to be using much ram. So
> I shut everything down. Samba, Apache, ypbind, everything I could think
> of. There was a change, but only a very slight one. So I did something I
> NEVER do on my Redhat box, I rebooted it. When it came back up it all
> was normal. So I shrugged my shoulders and went back to work. Two days
> later the same damn thing happened again. Again, the only workaround I
> could find was a reboot. I HATE rebooting Unix/Linux boxes, I have to
> reboot my  NT box enough as is.

Short answer: I don't have a clue. (-:

Long answer: Here are some ideas...

1. Some app is misconfigured and is constantly restarting/dumping
   core, and that's keeping your disk busy.  This happened on one
   machine I put 7.1 on -- the problem was an interaction between
   Apache and mod_ssl.  I didn't figure it out; I just removed Apache,
   since I didn't want a web server there anyway.
 
   Have you checked syslog and root's mailbox?

2. A kernel or driver bug is leaking memory.  If this is the case,
   your machine will probably eventually hang.

   Have you checked dmesg?
   
3. A userland app is leaking memory.  Top would show this -- start top
   and type 'M' (uppercase) to sort by memory use.  Type 'i'
   (lowercase) if you don't see a whole screenful of processes.

   The kde tools are known to leak, but not at the rate you're seeing.
   I generally have to restart kfm every couple of weeks.

4. Nothing is wrong; you're misreading the tea leaves.  You say top
   shows all memory in use?  You aren't basing that on the 4th line
   that shows "Mem: ######K av, ######K used", I hope.  Those two
   numbers are always nearly equal.  The Linux kernel caches
   aggressively -- it does its best to keep memory full so it won't
   have to read from disk.

   To see the paging rate, try vmstat.  Here's some sample vmstat
   output under heavy vm load.

jogger-egg> vmstat 5
   procs                      memory    swap          io     system         cpu
 r  b  w   swpd   free   buff  cache  si  so    bi    bo   in    cs  us  sy  id
 0  0  0  43316   3476   2896  46388   0   0     3     1    1    18   1   0   6
 0  0  0  43316   3476   2896  46388   0   0     0    11  127   124   0   0  99
 1  0  0  43316   1684   2132  29360   0   0     0     0  106   133   0   3  96
 2  0  0  56024   1548    220  15860   0 2542    1   636 5188   140   3  93   4
 2  0  0  69540   1620    220  16012   0 2703    0   676 5509   124   5  95   0
 2  0  1  81888   1024    220  16004   0 2470    0   617 5042   111   4  96   0
 1  0  0  82288  76864    220  15168   0 1005    0   251 2112   119   2  33  65
 0  0  0  82288  76864    220  15168   0   0     0     0  101   112   0   1  99
^C

   The interesting colmns are si and so (amount swapped in and out, in
   Kb) and bi/bo (amount of block I/O in Kb).  Also note how cache
   fell from 46 Mb to 15 Mb as memory got tight.

   The run you see is from a single PII/450MHz, 192 Mb RAM, and single
   IDE disk.  I ran a simple memory thrashing program for 20 seconds.
   If I'd run it longer, you would have seen si nonzero.

> So now to my question(s).
> 
> 1) How do I find out what app is tying up all of my memory? Top does not
> list any one app as chewing up all the RAM.

See above.

> 2) Is there a way to force a memory cleanup? (IE force all of the apps
> to "claim" there allocated memeory?)

"kill -9 ..." (-:

> 3) Is this a problem with Mandrake (v7.1)? (Or is this a PEBKAC
> problem?)

Unknown.

> 4) Am I going crazy?

Unknown.  Ask the voices.

> 5) Or could this be a problem with the SMP? This is the first time I
> have ever run Linux on a dual processor machine, so I have no idea if
> this could be related (I really doubt it, but in my line of work I have
> learned to question all things computer related)

I doubt it too. (-:

-- 
                                        K<bob>
[EMAIL PROTECTED], http://www.jogger-egg.com/

Reply via email to