Linux - memory leak??

Roman Ivanov

Member
Feb 5, 2000
44
0
0
I think i have a memory leak on my machine. i am running:
kernel 2.2.17, IPCHAINS
ssh2
named (p5)
mysql (2.23.27)
dhcpd
apsupc
dnetc :)
apache (last one)
sendmail (last one)
46 processes total
I run some programs (mostly any), when run free and some of memory (4-12kb) added to used.
Machine use is a server and i need to restart it every 21 days (used memory change from 13Mb to 34 Mb), ps -aux, top, si, ipcs dont help. Please tell how i can found a leak?? Any program that map the real memory (first mb kernel, when named, when free.... etc) ???
Any ideas??
 

1KrazyFool

Senior member
Oct 10, 1999
323
0
0
I don't get what your problem is, you didn't describe it very well. Have you checked out the cached RAM to see if that also goes up? Your system uses RAM for that.
 

Roman Ivanov

Member
Feb 5, 2000
44
0
0
problem is: I kill most of processes and
total_used - buffers - cache > total_RSS + shared
sometimes its bigger upto 10 Mb!!!!

ps -aux

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.7 1128 488 ? S Oct04 0:04 init [3]
root 2 0.0 0.0 0 0 ? SW Oct04 0:00 [kflushd]
root 3 0.0 0.0 0 0 ? SW Oct04 0:00 [kupdate]
root 4 0.0 0.0 0 0 ? SW Oct04 0:00 [kpiod]
root 5 0.0 0.0 0 0 ? SW Oct04 0:00 [kswapd]
root 190 0.0 1.0 1424 640 ? S Oct04 0:00 /sbin/pump -i eth0
root 330 0.0 0.7 1244 496 ? S Oct04 0:00 apcmain -f /apcupsd/apcupsd.conf
root 349 0.0 0.8 2368 556 ? S Oct04 0:00 /usr/local/sbin/sshd2
root 362 0.0 0.8 1168 532 ? S Oct04 0:05 syslogd -m 0
root 373 0.0 1.0 1392 648 ? S Oct04 0:00 klogd
daemon 387 0.0 0.8 1144 508 ? S Oct04 0:00 /usr/sbin/atd
root 401 0.0 0.9 1328 584 ? S Oct04 0:00 crond
root 415 0.0 0.7 1136 488 ? S Oct04 0:00 inetd
root 429 0.0 2.0 2612 1284 ? S Oct04 0:01 named
root 505 0.0 0.7 1312 476 ? S Oct04 0:00 /usr/sbin/dhcpd eth1
root 511 0.0 0.6 680 432 ? RN Oct04 8591:01 /root/dnetc/dnetc -quiet
root 528 0.0 1.3 1720 864 ? S Oct04 0:00 sh /usr/local/bin/safe_mysqld
mysql 564 0.0 4.0 12172 2552 ? S Oct04 0:00 /usr/local/libexec/mysqld ...
mysql 566 0.0 4.0 12172 2552 ? S Oct04 0:00 /usr/local/libexec/mysqld ...
mysql 567 0.0 4.0 12172 2552 ? S Oct04 0:00 /usr/local/libexec/mysqld ...
root 568 0.0 3.4 4596 2156 ? S Oct04 0:00 /usr/local/apache/bin/httpd
root 583 0.0 0.6 1092 388 tty1 S Oct04 0:00 /sbin/mingetty tty1
root 584 0.0 0.6 1092 388 tty2 S Oct04 0:00 /sbin/mingetty tty2
root 585 0.0 0.6 1092 388 tty3 S Oct04 0:00 /sbin/mingetty tty3
root 586 0.0 0.6 1092 388 tty4 S Oct04 0:00 /sbin/mingetty tty4
root 587 0.0 0.6 1092 388 tty5 S Oct04 0:00 /sbin/mingetty tty5
root 588 0.0 0.6 1092 388 tty6 S Oct04 0:00 /sbin/mingetty tty6
root 596 0.0 0.8 1232 568 ? S Oct04 0:00 apcser -f etc/apcupsd/apcupsd.conf
root 597 0.0 0.6 1272 424 ? S Oct04 0:00 apcnis -f etc/apcupsd/apcupsd.conf
root 1254 0.0 1.2 2464 784 ? S Oct04 0:00 sendmail: accepting connections
nobody 9007 0.0 3.9 4796 2492 ? S Oct08 0:01 /usr/local/apache/bin/httpd
nobody 9008 0.0 3.9 4788 2472 ? S Oct08 0:00 /usr/local/apache/bin/httpd
nobody 9009 0.0 3.8 4788 2468 ? S Oct08 0:01 /usr/local/apache/bin/httpd
nobody 9010 0.0 3.8 4788 2468 ? S Oct08 0:01 /usr/local/apache/bin/httpd
nobody 9011 0.0 3.9 4788 2476 ? S Oct08 0:01 /usr/local/apache/bin/httpd
nobody 9163 0.0 3.9 4788 2488 ? S Oct08 0:01 /usr/local/apache/bin/httpd
nobody 9229 0.0 3.9 4812 2492 ? S Oct08 0:00 /usr/local/apache/bin/httpd
nobody 9251 0.0 3.8 4788 2464 ? S Oct08 0:00 /usr/local/apache/bin/httpd
nobody 9252 0.0 3.9 4788 2492 ? S Oct08 0:00 /usr/local/apache/bin/httpd
nobody 9253 0.0 3.9 4788 2492 ? S Oct08 0:00 /usr/local/apache/bin/httpd
root 13190 4.3 1.9 2492 1244 ? S 08:26 0:00 /usr/local/sbin/sshd2
roman 13191 1.5 1.5 1760 1004 pts/0 S 08:26 0:00 -bash
roman 13202 0.0 1.5 2656 980 pts/0 R 08:26 0:00 ps -aux

free:

total used free shared buffers cached
Mem: 63304 46236 17068 36508 16172 9292
-/+ buffers/cache: 20772 42532
Swap: 409616 652 408964

ipcs

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x10feed01 0 root 644 25204 4

------ Semaphore Arrays --------
key semid owner perms nsems status
0x00feed00 0 root 644 2

------ Message Queues --------
key msqid owner perms used-bytes messages