2002-04-14 12:23:40

by ivan

[permalink] [raw]
Subject: Memory Leaking. Help!

Hi,

I have posted this to linux-mm list but it is a bit quite there, so I
decided to try this one.

I am running 7.2RedHat kernel 2.4.9-31 on Dell 4400 PowerEdge
Server. Dual CPU 990MHz.

The machine was a lemon from the start. We paid for it 16000$, to find out
that one SCSI controller and two SCSI disk were broken out of the box.

It kept crushing a couple time a months with clear logs. (My Desktop
Pentium 2 has being running for a year).

Machine is under warranty; Dell replaced mum and both CPUs. Still going
down. They refused to replace RAM (4Gb) asking me to test memory by
swapping RAM around to see if frequency of crushes will decrease/increase.
This is despite all my explanations that it was a production server.

I have to admit: "Buy DELL and you in Hell" this is despite all the good
things Dell developers are doing for the linux community.

10 Days ago I installed DNS and DHCPd servers from RedHat and noticed that
"top" shows the amount of consumed memory is slowly and constantly
growing. Machine became unstable and a few users complained that their
files disappeared. ( we have good backup ). I re-booted 4 days ago and now
it looks it is doing it again. Could this be BIND?


1) Could you please advice how can I detect memory leaks. ( I guess it is
not an easy task on production server.

2) Is there a tool which I can use to log memory usage

3) Any help will be appreciated.


Thank you in advance,
Ivan.



--

There's an old story about the person who wished his computer were as
easy to use as his telephone. That wish has come true, since I no
longer know how to use my telephone.

================================================================================

Ivan Teliatnikov,
F05 David Edgeworth Building,
Department of Geology and Geophysics,
School of Geosciences,
University of Sydney, 2006
Australia

e-mail: [email protected]
ph: 061-2-9351-2031 (w)
fax: 061-2-9351-0184 (w)

===============================================================================


2002-04-14 13:16:43

by Itai Nahshon

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

On Sunday 14 April 2002 15:23 pm, ivan wrote:
> Machine is under warranty; Dell replaced mum and both CPUs. Still going
> down. They refused to replace RAM (4Gb) asking me to test memory by
> swapping RAM around to see if frequency of crushes will decrease/increase.
> This is despite all my explanations that it was a production server.

Have you tried memtest86 ?

-- Itai

2002-04-14 13:51:48

by Alan

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

> 10 Days ago I installed DNS and DHCPd servers from RedHat and noticed that
> "top" shows the amount of consumed memory is slowly and constantly
> growing. Machine became unstable and a few users complained that their
> files disappeared. ( we have good backup ). I re-booted 4 days ago and now
> it looks it is doing it again. Could this be BIND?

Wildly improbable. Slow shifts in memory usage occur naturally so don't be
totally mislead by it. Named for example will grow and shrink over time
according to what it has cached and what people asked for.

> 1) Could you please advice how can I detect memory leaks. ( I guess it is
> not an easy task on production server.
>
> 2) Is there a tool which I can use to log memory usage

ps, looking in /proc at the address space maps too.

What you almost certainly want to do first is run memtest86 as suggested
by others.

2002-04-14 22:51:23

by ivan

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

On Sun, 14 Apr 2002, Alan Cox wrote:

> > 10 Days ago I installed DNS and DHCPd servers from RedHat and noticed that
> > "top" shows the amount of consumed memory is slowly and constantly
> > growing. Machine became unstable and a few users complained that their
> > files disappeared. ( we have good backup ). I re-booted 4 days ago and now
> > it looks it is doing it again. Could this be BIND?
>
> Wildly improbable. Slow shifts in memory usage occur naturally so don't be
> totally mislead by it. Named for example will grow and shrink over time
> according to what it has cached and what people asked for.

But it took half of my swap (4GB) as well. A bit too much
for a little bind. How to explain this?

>
> > 1) Could you please advice how can I detect memory leaks. ( I guess it is
> > not an easy task on production server.
> >
> > 2) Is there a tool which I can use to log memory usage
>
> ps, looking in /proc at the address space maps too.
>
> What you almost certainly want to do first is run memtest86 as suggested
> by others.
>
>

--

There's an old story about the person who wished his computer were as
easy to use as his telephone. That wish has come true, since I no
longer know how to use my telephone.

================================================================================

Ivan Teliatnikov,
F05 David Edgeworth Building,
Department of Geology and Geophysics,
School of Geosciences,
University of Sydney, 2006
Australia

e-mail: [email protected]
ph: 061-2-9351-2031 (w)
fax: 061-2-9351-0184 (w)

===============================================================================

2002-04-14 23:55:58

by Alan

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

> > totally mislead by it. Named for example will grow and shrink over time
> > according to what it has cached and what people asked for.
>
> But it took half of my swap (4GB) as well. A bit too much
> for a little bind. How to explain this?

2Gb seems a bit odd - are you sure bind is the one that ate it ?

What does ps -aux imply has all the memory ?

2002-04-15 00:18:08

by Tomasz Rola

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 14 Apr 2002, ivan wrote:

> Hi,
>
> I have posted this to linux-mm list but it is a bit quite there, so I
> decided to try this one.
[...]
> 2) Is there a tool which I can use to log memory usage

Perhaps memstat can help you. From the manpage:

memstat - Identify what's using up virtual memory.

On my Debian it's in the memstat package, should be the same on RH.

bye
T.

- --
** A C programmer asked whether computer had Buddha's nature. **
** As the answer, master did "rm -rif" on the programmer's home **
** directory. And then the C programmer became enlightened... **
** **
** Tomasz Rola mailto:[email protected] **


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv

iQA/AwUBPLoY1hETUsyL9vbiEQKPpgCfcqZ2VsfgktUIZHhU02dPAszca1QAnjUl
2e061Zo24OX/nV+NSrZQ1dEL
=MY4s
-----END PGP SIGNATURE-----

2002-04-15 00:28:18

by ivan

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

On Mon, 15 Apr 2002, Alan Cox wrote:

> > > totally mislead by it. Named for example will grow and shrink over time
> > > according to what it has cached and what people asked for.
> >
> > But it took half of my swap (4GB) as well. A bit too much
> > for a little bind. How to explain this?
>
> 2Gb seems a bit odd - are you sure bind is the one that ate it ?

That was 4 GB not 2.

No, I do not. That is why I asked is there a way to find out what is
eating ram. I am not sure if this a leakage. I am only a paranoid
sysadmin.



> What does ps -aux imply has all the memory ?

Top at 9am showed 3.2GB of availabe memory.

Top at 10am showed 2.3Gb of available memory

This top at 11am
10:19am up 13:23, 6 users, load average: 0.07, 0.03, 0.01
143 processes: 142 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states: 0.0% user, 5.0% system, 0.0% nice, 94.0% idle
CPU1 states: 0.0% user, 1.0% system, 0.0% nice, 98.0% idle
Mem: 3799080K av, 2215132K used, 1583948K free, 1580K shrd, 377916K
buff
Swap: 8192992K av, 0K used, 8192992K free 1515392K
cached

Mashine is doing NFS and DNS, not much load?

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1388 524 ? S Apr14 0:03 init
root 2 0.0 0.0 0 0 ? SW Apr14 0:00 [keventd]
root 3 0.0 0.0 0 0 ? SWN Apr14 0:00
[ksoftirqd_CPU0]
root 4 0.0 0.0 0 0 ? SWN Apr14 0:00
[ksoftirqd_CPU1]
root 5 0.0 0.0 0 0 ? SW Apr14 0:05 [kswapd]
root 6 0.0 0.0 0 0 ? SW Apr14 0:00 [kreclaimd]
root 7 0.0 0.0 0 0 ? SW Apr14 0:01 [bdflush]
root 8 0.0 0.0 0 0 ? SW Apr14 0:00 [kupdated]
root 9 0.0 0.0 0 0 ? SW< Apr14 0:00
[mdrecoveryd]
root 16 0.0 0.0 0 0 ? SW Apr14 0:00 [aacraid]
root 19 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 102 0.0 0.0 0 0 ? SW Apr14 0:00 [khubd]
root 200 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 201 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 202 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 203 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 204 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 205 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 206 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 207 0.0 0.0 0 0 ? SW Apr14 0:01 [kjournald]
root 208 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
root 611 0.0 0.0 1452 596 ? S Apr14 0:00 syslogd -m
0
root 616 0.0 0.0 2000 1140 ? S Apr14 0:00 klogd -2
rpc 636 0.0 0.0 1544 656 ? S Apr14 0:00 portmap
rpcuser 664 0.0 0.0 1596 768 ? S Apr14 0:00 rpc.statd
root 760 0.0 0.0 0 0 ? SW Apr14 0:00 [kjournald]
ntp 780 0.0 0.0 1900 1892 ? SL Apr14 0:00 ntpd -U ntp
root 849 0.0 0.0 1496 636 ? S Apr14 0:00
/usr/sbin/automou
root 865 0.0 0.0 1500 640 ? S Apr14 0:00
/usr/sbin/automou
daemon 890 0.0 0.0 1424 580 ? S Apr14 0:00
/usr/sbin/atd
named 908 0.0 0.1 13956 3988 ? S Apr14 0:00 named -u
named
named 910 0.0 0.1 13956 3988 ? S Apr14 0:00 named -u
named
named 911 0.0 0.1 13956 3988 ? S Apr14 0:00 named -u
named
named 912 0.0 0.1 13956 3988 ? S Apr14 0:00 named -u
named
named 913 0.0 0.1 13956 3988 ? S Apr14 0:00 named -u
named
named 914 0.0 0.1 13956 3988 ? S Apr14 0:00 named -u
named
root 934 0.0 0.0 2652 1248 ? S Apr14 0:01
/usr/sbin/sshd
root 967 0.0 0.0 2296 1040 ? S Apr14 0:00 xinetd
-stayalive
lp 991 0.0 0.0 2560 984 ? S Apr14 0:00 lpd Waiting
root 1021 0.0 0.0 1776 636 ? S Apr14 0:00 rpc.rquotad
root 1026 0.0 0.0 2012 1164 ? S Apr14 0:00 rpc.mountd
root 1031 0.0 0.0 0 0 ? SW Apr14 0:02 [nfsd]
root 1032 0.0 0.0 0 0 ? SW Apr14 0:02 [nfsd]
root 1033 0.0 0.0 0 0 ? SW Apr14 0:02 [nfsd]
root 1034 0.0 0.0 0 0 ? SW Apr14 0:02 [nfsd]
root 1035 0.0 0.0 0 0 ? SW Apr14 0:02 [nfsd]
root 1036 0.0 0.0 0 0 ? SW Apr14 0:02 [nfsd]
root 1037 0.0 0.0 0 0 ? SW Apr14 0:02 [nfsd]
root 1038 0.0 0.0 0 0 ? SW Apr14 0:02 [nfsd]
root 1039 0.0 0.0 0 0 ? SW Apr14 0:00 [lockd]
root 1040 0.0 0.0 0 0 ? SW Apr14 0:00 [rpciod]
root 1046 0.0 0.0 3844 1580 ? S Apr14 0:00 amd -F
/etc/amd.c
root 2202 0.0 0.0 1384 480 ? S Apr14 0:00
/opt/win4lin/bin/
root 2254 0.0 0.0 1416 484 ? S Apr14 0:00 gpm -t ps/2
-m /d
root 2272 0.0 0.0 1572 684 ? S Apr14 0:00 crond
xfs 2332 0.0 0.1 5520 4228 ? S Apr14 0:00 xfs
-droppriv -da
root 2358 0.0 0.0 2596 948 ? S Apr14 0:00
/usr/sbin/nsrexec
root 2368 0.0 0.0 2564 1196 ? S Apr14 0:00
/usr/sbin/nsrexec
root 2374 0.0 0.0 8840 852 ? S Apr14 0:00
/usr/bin/sdaemon
root 2375 0.0 0.0 8840 852 ? S Apr14 0:00
/usr/bin/sdaemon
root 2378 0.0 0.0 2320 1132 tty1 S Apr14 0:00 login --
root
root 2379 0.0 0.0 1360 440 tty2 S Apr14 0:00
/sbin/mingetty tt
root 2380 0.0 0.0 1360 440 tty3 S Apr14 0:00
/sbin/mingetty tt
root 2381 0.0 0.0 1360 440 tty4 S Apr14 0:00
/sbin/mingetty tt
root 2382 0.0 0.0 1360 440 tty5 S Apr14 0:00
/sbin/mingetty tt
root 2383 0.0 0.0 1360 440 tty6 S Apr14 0:00
/sbin/mingetty tt
root 2754 0.0 0.0 1408 496 ? SN Apr14 0:41 free -b -s
30 -o
root 4357 0.0 0.0 3400 1860 ? S 07:46 0:02
/usr/sbin/sshd
root 4359 0.0 0.0 2436 1320 pts/1 S 07:47 0:00 -bash
root 4459 0.1 0.0 3656 2028 ? S 08:04 0:15
/usr/sbin/sshd
root 4462 0.0 0.0 2440 1320 pts/2 S 08:04 0:00 -bash
root 5610 0.0 0.0 2440 1308 tty1 S 09:34 0:00 -bash
root 5757 0.0 0.0 2204 972 tty1 S 09:36 0:00 /bin/sh
/usr/X11R
root 5764 0.0 0.0 2420 672 tty1 S 09:36 0:00 xinit
/etc/X11/xi
root 5765 0.2 0.2 17664 10584 ? S< 09:36 0:07 /etc/X11/X
:0
root 5768 0.0 0.1 7176 4004 tty1 S 09:36 0:00
/usr/bin/gnome-se
root 5787 0.0 0.0 6268 2084 ? S 09:36 0:00
gnome-smproxy --s
root 5791 0.0 0.0 5776 3584 ? S 09:36 0:01 sawfish
--sm-clie
root 5816 0.0 0.0 7120 3220 ? S 09:36 0:00 magicdev
--sm-cli
root 5818 0.0 0.2 40124 11068 ? S 09:36 0:01 nautilus
start-he
root 5820 0.0 0.1 8652 5252 ? S 09:36 0:00 panel
--sm-client
root 5826 0.0 0.0 3276 1276 ? S 09:36 0:00
gnome-name-servic
root 5829 0.0 0.0 3936 2348 ? S 09:36 0:00 oafd
--ac-activat
root 5834 0.0 0.0 3236 1696 ? S 09:36 0:00 gconfd-1
--oaf-ac
root 5838 0.0 0.2 40124 11068 ? S 09:36 0:00 nautilus
start-he
root 5839 0.0 0.2 40124 11068 ? S 09:36 0:00 nautilus
start-he
root 5840 0.0 0.2 40124 11068 ? S 09:36 0:00 nautilus
start-he
root 5842 0.0 0.1 7596 3972 ? S 09:36 0:00
tasklist_applet -
root 5844 0.0 0.1 7520 3904 ? S 09:36 0:00
deskguide_applet
root 5847 0.0 0.0 7508 3696 ? S 09:36 0:00
multiload_applet
root 5853 0.0 0.1 12088 5740 ? S 09:36 0:00
nautilus-throbber
root 5859 0.0 0.1 13444 7160 ? S 09:37 0:00 hyperbola
--oaf-a
root 5861 0.0 0.1 12072 5800 ? S 09:37 0:00
nautilus-history-
root 5863 0.0 0.1 12352 6336 ? S 09:37 0:00
nautilus-news --o
root 5865 0.0 0.1 12036 5620 ? S 09:37 0:00
nautilus-notes --
root 5879 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5880 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5881 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5882 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5885 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5889 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5890 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5893 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5895 0.0 0.1 8320 4496 ? S 09:37 0:00
gnome-terminal --
root 5896 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5897 0.0 0.2 40124 11068 ? S 09:37 0:00 nautilus
start-he
root 5899 0.0 0.0 1424 568 ? S 09:37 0:00
gnome-pty-helper
root 5900 0.0 0.0 2516 1380 pts/5 S 09:37 0:00 bash
root 6135 0.0 0.0 2512 1352 pts/6 S 09:38 0:00 bash
root 6158 0.0 0.0 2832 1676 pts/6 S 09:38 0:00 slogin
eos14 -l r
root 6807 0.1 0.3 20780 14908 pts/5 S 09:39 0:02
/opt/acrobat/Read
root 6834 0.2 0.3 19932 14248 pts/2 S 09:45 0:07
/opt/acrobat/Read
root 7048 5.0 0.0 3420 1960 ? S 10:26 0:00
/usr/sbin/sshd
scottd 7052 1.2 0.0 2796 1548 ? S 10:26 0:00
/usr/bin/perl /us
scottd 7055 6.2 0.0 52052 1768 ? S 10:26 0:00
/opt/win4lin/publ
scottd 7310 71.0 0.1 50068 4380 ? R 10:26 0:01
/opt/win4lin/publ
scottd 7311 0.0 0.0 25960 392 ? S 10:26 0:00 auserver
0x0 0x8
scottd 7312 4.5 0.0 5464 2544 ? S 10:26 0:00
/opt/win4lin/xcrt
root 7313 0.0 0.0 2828 900 pts/2 R 10:26 0:00 ps -aux


--

There's an old story about the person who wished his computer were as
easy to use as his telephone. That wish has come true, since I no
longer know how to use my telephone.

================================================================================

Ivan Teliatnikov,
F05 David Edgeworth Building,
Department of Geology and Geophysics,
School of Geosciences,
University of Sydney, 2006
Australia

e-mail: [email protected]
ph: 061-2-9351-2031 (w)
fax: 061-2-9351-0184 (w)

===============================================================================

2002-04-15 05:18:36

by xystrus

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

On Mon, Apr 15, 2002 at 10:28:00AM +1000, ivan wrote:
> That was 4 GB not 2.
>
> No, I do not. That is why I asked is there a way to find out what is
> eating ram. I am not sure if this a leakage. I am only a paranoid
> sysadmin.
>

I think you said this was a server, didn't you?

You neglected to mention that you're running X and Nautilus on this
server. You probably don't need this stuff running on a server, and
it is chewing up a good amount of RAM. If you don't absolutely need
X, try bringing the system up in run level 3 and see if your problem
disappears...

Memory usage (as reported below) of named looks fine.

> named 908 0.0 0.1 13956 3988 ? S Apr14 0:00 named -u

This is probably a big waste:

> root 5765 0.2 0.2 17664 10584 ? S< 09:36 0:07 /etc/X11/X
> :0
> root 5818 0.0 0.2 40124 11068 ? S 09:36 0:01 nautilus
> start-he
> root 5838 0.0 0.2 40124 11068 ? S 09:36 0:00 nautilus
> start-he
> root 5839 0.0 0.2 40124 11068 ? S 09:36 0:00 nautilus
> start-he
> root 5840 0.0 0.2 40124 11068 ? S 09:36 0:00 nautilus

[etc. snipped]

You also seem to have someone on the system running win4lin and
multiple instances of adobe acrobat reader. If this is really a
server, perhaps it would be better to have them run those things
elsewhere...

Hope that helps

--
Xy
[email protected]

2002-04-15 06:09:20

by john slee

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

On Mon, Apr 15, 2002 at 01:18:34AM -0400, xystrus wrote:
> On Mon, Apr 15, 2002 at 10:28:00AM +1000, ivan wrote:
> > That was 4 GB not 2.
> >
> > No, I do not. That is why I asked is there a way to find out what is
> > eating ram. I am not sure if this a leakage. I am only a paranoid
> > sysadmin.
> >
>
> I think you said this was a server, didn't you?
>
> You neglected to mention that you're running X and Nautilus on this
> server. You probably don't need this stuff running on a server, and
> it is chewing up a good amount of RAM. If you don't absolutely need
> X, try bringing the system up in run level 3 and see if your problem
> disappears...

it could be a server for x11-based thin clients

--
R N G G "Well, there it goes again... And we just sit
I G G G here without opposable thumbs." -- gary larson

2002-04-15 09:30:09

by Alan

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

> > What does ps -aux imply has all the memory ?
> Top at 9am showed 3.2GB of availabe memory.
> Top at 10am showed 2.3Gb of available memory

That seems reasonable. The kernel knows free memory is waste. Until it
has used all the available memory why does it need to worry about freeing
caches ?

Alan
--
First the west got slaves by raiding their nations
Then the west got slaves by invading their nations
Now the west gets slaves from unrepayable loans to their nations
Next the west will get slaves from owning their ideas

2002-04-15 10:00:36

by David Schwartz

[permalink] [raw]
Subject: Re: Memory Leaking. Help!


>No, I do not. That is why I asked is there a way to find out what is
>eating ram. I am not sure if this a leakage. I am only a paranoid
>sysadmin.

In fact, you have no reason whatsoever to believe the memory is leaking.
It's just being *used*.

>>What does ps -aux imply has all the memory ?

>Top at 9am showed 3.2GB of availabe memory.
>
>Top at 10am showed 2.3Gb of available memory
>
>This top at 11am
>10:19am up 13:23, 6 users, load average: 0.07, 0.03, 0.01
>143 processes: 142 sleeping, 1 running, 0 zombie, 0 stopped
>CPU0 states: 0.0% user, 5.0% system, 0.0% nice, 94.0% idle
>CPU1 states: 0.0% user, 1.0% system, 0.0% nice, 98.0% idle
>Mem: 3799080K av, 2215132K used, 1583948K free, 1580K shrd, 377916K
>buff
>Swap: 8192992K av, 0K used, 8192992K free 1515392K
>cached

If you don't want the memory to be used, take it out of the system and let
it sit on your desk. If you put the memory in the system, the system assumes
that you want to use it. It keeps data in memory that it would otherwise
throw away, that we if it's used again, it doesn't have to be fetched from
disk.

DS


2002-04-15 11:32:31

by Roy Sigurd Karlsbakk

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

> > > 10 Days ago I installed DNS and DHCPd servers from RedHat and noticed that
> > > "top" shows the amount of consumed memory is slowly and constantly
> > > growing. Machine became unstable and a few users complained that their
> > > files disappeared. ( we have good backup ). I re-booted 4 days ago and now
> > > it looks it is doing it again. Could this be BIND?
> >
> > Wildly improbable. Slow shifts in memory usage occur naturally so don't be
> > totally mislead by it. Named for example will grow and shrink over time
> > according to what it has cached and what people asked for.
>
> But it took half of my swap (4GB) as well. A bit too much
> for a little bind. How to explain this?
>

Bind can be greedy on memory usage. Upgrade to 9.2.0, and set
max-cache-size to limit it :-)

--
Roy Sigurd Karlsbakk, Datavaktmester

Computers are like air conditioners.
They stop working when you open Windows.

2002-04-15 12:29:20

by Eugenio Mastroviti

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

ivan wrote:

> This top at 11am
> 10:19am up 13:23, 6 users, load average: 0.07, 0.03, 0.01
> 143 processes: 142 sleeping, 1 running, 0 zombie, 0 stopped
> CPU0 states: 0.0% user, 5.0% system, 0.0% nice, 94.0% idle
> CPU1 states: 0.0% user, 1.0% system, 0.0% nice, 98.0% idle
> Mem: 3799080K av, 2215132K used, 1583948K free, 1580K shrd, 377916K
> buff
> Swap: 8192992K av, 0K used, 8192992K free 1515392K
> cached
>
> Mashine is doing NFS and DNS, not much load?
>


Perhaps it's worth noting that of those 2.2 GB in use, 1.5 GB are used
as cache; seems to me there's no leak, your system is just caching as
much data as it can in memory. The actual memory in use (check with
'free') is total-(buffers+cache)= 2.2-(0.37+1.51)GB=about 320 MB, which
seems reasonable enough

Eugenio
--
Laissez Faire Economics is the theory that if each acts like a vulture,
all will end as doves.

2002-04-15 16:06:45

by Kervin Pierre

[permalink] [raw]
Subject: Re: Memory Leaking. Help!

Eugenio Mastroviti wrote:
> much data as it can in memory. The actual memory in use (check with
> 'free') is total-(buffers+cache)= 2.2-(0.37+1.51)GB=about 320 MB, which

This is interesting. What exactly is buffers and cache used for?

I had the same issue with the original poster with a new server. A
fresh install with nothing significant running ( no bind nor sendmail,
etc. ) reported that over 450 out of 512 MB was used, but looking at the
process usage on top I barelly got 5% memory usuage by process. If the
above calculation ( memory use = total - buffers - cache ) is correct
then the memory use drops to ~100 MB.

I guess what's confusing is that total memory usuage is including
buffers and cache. If that memory is available to applications,
shouldn't it be removed from the "total used" figure?

--Kervin


--
http://linuxquestions.org/ - Ask linux questions, give linux help.
http://splint.org/ - Write safe C code. splint source-code analyzer.

2002-04-16 00:36:14

by David Schwartz

[permalink] [raw]
Subject: Re: Memory Leaking. Help!



On Mon, 15 Apr 2002 11:59:40 -0400, Kervin Pierre wrote:
>Eugenio Mastroviti wrote:
>>much data as it can in memory. The actual memory in use (check with
>>'free') is total-(buffers+cache)= 2.2-(0.37+1.51)GB=about 320 MB, which
>
>This is interesting. What exactly is buffers and cache used for?

It is used to keep information that the kernel might otherwise throw away in
case it is needed later. It is also used to accumulate writes so that they
can be made at a time where they can be done more efficiently.

>I had the same issue with the original poster with a new server. A
>fresh install with nothing significant running ( no bind nor sendmail,
>etc. ) reported that over 450 out of 512 MB was used, but looking at the
>process usage on top I barely got 5% memory usage by process. If the
>above calculation ( memory use = total - buffers - cache ) is correct
>then the memory use drops to ~100 MB.

So you now have a ton of information. You have 512Mb of physical RAM, 450 of
that is being used. 100Mb of that is process memory, 350Mb of that is buffers
and cache.

>I guess what's confusing is that total memory usuage is including
>buffers and cache. If that memory is available to applications,
>shouldn't it be removed from the "total used" figure?

Are you arguing that you shouldn't have all the information the kernel is
providing you? That some of it should be hidden from you and memory should be
said to be free when it really isn't?

All of your physical memory, less what is used by the kernel itself, is
always available to applications. That memory is being used. Really.

If you don't want your memory to be used, take it out of your computer. You
paid good money for it. The kernel is using it. You should be happy.

DS