PDA

View Full Version : Need help to diagnosis memory leak issue



sling1947
3rd July 2007, 10:32 PM
Ever since I installed FC about 10 days ago, I have experienced at least twice my system completely froze and need to reboot. I left it on for a weekend and came back to see it freeze.
I found out I have more than 60K memory to begin with, a little more than 30K by the end of the day, then dropped to about 10K the following morning.

How do I find out what process cause any issue? Any known memory issue of FC7 or FC overall?

Appreciate any help.

Thanks.

lazlow
3rd July 2007, 10:54 PM
How much memory in your system? Because if you are down to 60k free you do not have enough.

Try free and post back what it gives you.

[herb@localhost ~]$ free
total used free shared buffers cached
Mem: 2075396 2019248 56148 0 12596 1480216
-/+ buffers/cache: 526436 1548960
Swap: 8289488 68 8289420


Lazlow

sling1947
5th July 2007, 03:03 AM
Sorry, I means 60M. I have a humble desktop in the office, total mem=512M. I just remotely checked it. It droped to 6M now.

lazlow
5th July 2007, 03:30 AM
If you post the results of free we might have a place to start. You might also want to post the results of top.

sling1947
5th July 2007, 03:38 AM
All the information I can get so far.


top - 19:34:24 up 2 days, 7:46, 2 users, load average: 0.01, 0.01, 0.00
Tasks: 121 total, 1 running, 120 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 99.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 507116k total, 500312k used, 6804k free, 112868k buffers
Swap: 524280k total, 32k used, 524248k free, 178336k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 15 0 2136 636 548 S 0 0.1 0:01.11 init
2 root RT 0 0 0 0 S 0 0.0 0:00.04 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:00.00 watchdog/0
5 root RT 0 0 0 0 S 0 0.0 0:00.04 migration/1
6 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/1
7 root RT 0 0 0 0 S 0 0.0 0:00.00 watchdog/1
8 root 10 -5 0 0 0 S 0 0.0 0:00.03 events/0
9 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/1
10 root 17 -5 0 0 0 S 0 0.0 0:00.00 khelper
11 root 11 -5 0 0 0 S 0 0.0 0:00.00 kthread
51 root 10 -5 0 0 0 S 0 0.0 0:00.00 kblockd/0
52 root 10 -5 0 0 0 S 0 0.0 0:00.00 kblockd/1
53 root 17 -5 0 0 0 S 0 0.0 0:00.00 kacpid
129 root 17 -5 0 0 0 S 0 0.0 0:00.00 cqueue/0
130 root 18 -5 0 0 0 S 0 0.0 0:00.00 cqueue/1
131 root 10 -5 0 0 0 S 0 0.0 0:00.00 ksuspend_usbd
134 root 10 -5 0 0 0 S 0 0.0 0:00.00 khubd
136 root 10 -5 0 0 0 S 0 0.0 0:00.00 kseriod
161 root 15 0 0 0 0 S 0 0.0 0:00.01 pdflush
162 root 16 0 0 0 0 S 0 0.0 0:00.02 pdflush
163 root 10 -5 0 0 0 S 0 0.0 0:00.21 kswapd0
164 root 18 -5 0 0 0 S 0 0.0 0:00.00 aio/0
165 root 19 -5 0 0 0 S 0 0.0 0:00.00 aio/1


[root@spare01 ~]# free
total used free shared buffers cached
Mem: 507116 501560 5556 0 112972 178344
-/+ buffers/cache: 210244 296872
Swap: 524280 32 524248

[root@spare01 ~]# cat /proc/meminfo
MemTotal: 507116 kB
MemFree: 5560 kB
Buffers: 112988 kB
Cached: 178344 kB
SwapCached: 28 kB
Active: 217892 kB
Inactive: 181040 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 507116 kB
LowFree: 5560 kB
SwapTotal: 524280 kB
SwapFree: 524248 kB
Dirty: 248 kB
Writeback: 0 kB
AnonPages: 107660 kB
Mapped: 42952 kB
Slab: 36168 kB
SReclaimable: 20140 kB
SUnreclaim: 16028 kB
PageTables: 3580 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 777836 kB
Committed_AS: 344640 kB
VmallocTotal: 516088 kB
VmallocUsed: 4768 kB
VmallocChunk: 510964 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB

lazlow
5th July 2007, 04:08 AM
Ok, first Linux uses memory different than windows. If memory is not in active use, it is "floated" over to be used as cache and buffers. If you are not using a significant amount of swap (you are not) you are not running out of memory. Here is my free (which is just fine):

[herb@localhost ~]$ free
total used free shared buffers cached
Mem: 2075396 2004004 71392 0 24328 1597600
-/+ buffers/cache: 382076 1693320
Swap: 8289488 4 8289484


It looks like you are running everything as root. Just as a general rule this is a very bad idea.

Here is my top as a comparison:



top - 22:00:22 up 2:35, 1 user, load average: 2.22, 2.21, 2.24
Tasks: 130 total, 3 running, 127 sleeping, 0 stopped, 0 zombie
Cpu(s): 2.3%us, 1.5%sy, 94.2%ni, 0.0%id, 0.0%wa, 0.2%hi, 1.8%si, 0.0%st
Mem: 2075396k total, 1977528k used, 97868k free, 25268k buffers
Swap: 8289488k total, 60k used, 8289428k free, 1569180k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3087 herb 39 19 26956 20m 996 R 99 1.0 125:18.28 mprime
3086 herb 39 19 26956 20m 996 R 94 1.0 125:31.12 mprime
3227 herb 15 0 161m 39m 13m S 4 2.0 5:04.81 klibido
10428 herb 15 0 39216 11m 9208 S 2 0.6 0:00.32 gnome-terminal
2871 herb 16 0 79848 30m 28m S 0 1.5 0:28.74 sensors-applet
2955 herb 15 0 326m 131m 67m S 0 6.5 3:28.58 firefox-bin
1 root 15 0 2136 640 548 S 0 0.0 0:01.08 init
2 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:00.00 watchdog/0
5 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/1
6 root 39 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/1
7 root RT 0 0 0 0 S 0 0.0 0:00.00 watchdog/1
8 root 10 -5 0 0 0 S 0 0.0 0:00.03 events/0
9 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/1
10 root 10 -5 0 0 0 S 0 0.0 0:00.00 khelper
11 root 10 -5 0 0 0 S 0 0.0 0:00.00 kthread


Assuming your system had been running for a few hours, nothing really hops out at me as bad. If the system had just been rebooted wait a couple of hours and look at top again. If much has changed post the new results.

The crash could be a hardware issue. Memtest86+ is available on its own boot disks(just google). Leaving this run overnight will determine if it is a hardware issue or not. Often people will only check the system for a few minutes and call it good, but it is not. I have found on several occasions that bad memory will not show up as bad until several hours of testing is done. I have also ran into situations where perfectly good memory (5 years of good service) just up and goes bad (unusual in my experience).

Good Luck
Lazlow

sling1947
5th July 2007, 05:00 AM
Thanks for your advice. I will get Memtest86+ to help diagnosis.

One thing I don't understand is that most those processes initiated either by /sbin/service directly or indirectly. I don't have saying what user that process is running. How will I choose to run certain processes in other users?

lazlow
5th July 2007, 05:52 AM
The system processes you won't. But since there was not a single instance of a user, I assumed that you were running everything as root. If you compare your top and mine you will see a great similarity of the processes run as root(this will be true for any F7 system).