[lugip] losing memory
Rod Nayfield
rod at nayfield.com
Sun Sep 14 12:08:44 EDT 2008
so /proc/<pid>/stat will show your RSS assuming that your kernel isn't
really ancient
It is the 24th field in that file on my (2.6.18) kernel. It might
differ for your kernel.
So I can do:
# cat /proc/[0-9]*/stat | awk '{print $2 " " $24}'|sort -rnk2 | head
to show the top ten consumers of RSS (numbers are in pages)
On Sep 14, 2008, at 11:05 AM, Thomas Pfau wrote:
> Thanks for the reply. Unfortunately, this thing doesn't have 'top'
> on it and the 'ps' only shows pid, uid, vmsize, stat and command. I
> think the best I'll be able to do is monitor things in /proc.
> Here's /proc/cpuinfo and /proc/meminfo:
>
> processor : 0
> cpu model : MIPS 4KEc V4.8
> BogoMIPS : 211.35
> wait instruction : no
> microsecond timers : yes
> extra interrupt vector : yes
> hardware watchpoint : yes
> VCED exceptions : not available
> VCEI exceptions : not available
>
> total: used: free: shared: buffers: cached:
> Mem: 14655488 13946880 708608 0 1191936 2568192
> Swap: 0 0 0
> MemTotal: 14312 kB
> MemFree: 692 kB
> MemShared: 0 kB
> Buffers: 1164 kB
> Cached: 2508 kB
> SwapCached: 0 kB
> Active: 3560 kB
> Inactive: 1712 kB
> HighTotal: 0 kB
> HighFree: 0 kB
> LowTotal: 14312 kB
> LowFree: 692 kB
> SwapTotal: 0 kB
> SwapFree: 0 kB
>
> Rod Nayfield wrote:
>>
>> the vmsize (aka VIRT or VSZ) for a process shows its address space,
>> not resident pages. Memory pages in linux are allocated on-
>> demand. (for example, if you malloc() you will grow the vsz of the
>> process - but you won't take any resident pages until you access
>> them).
>>
>> You probably want to watch resident size to find a memory leak in a
>> process ... the easiest way would be to start top and sort by %MEM
>> (e.g. hit ">" once)
>>
>> If that doesn't help, take a step back and cat /proc/meminfo every
>> 5 minutes to a file so you can see what pages are actually taking
>> up space (e.g. confirm that they are anonymous pages, make sure
>> that you're not running out of lowmem (if it's 32 bit kernel))
>>
>> -rod
>>
>>
>>
>> On Sep 13, 2008, at 10:35 PM, Thomas Pfau wrote:
>>
>>> I have an Actiontec DSL modem that likes to hang after 6-8 hours of
>>> use. I have been trying to debug what's causing this and think it
>>> might
>>> be running out of memory. The device runs linux with busybox. I
>>> can
>>> telnet to it and it has a few command line utilities so I can find
>>> out
>>> what's going on to some extent.
>>>
>>> What I've seen while watching it today is that 'free' will report
>>> less
>>> free memory as time goes on. The buffer count stays the same
>>> until free
>>> memory gets real low then the system takes buffers to get free RAM.
>>> From the rate it was disappearing, I have a feeling that after 6-8
>>> hours, all of the memory is consumed and that's why it's hanging.
>>>
>>> I can't figure out where the memory is going, though. Vmsize
>>> reported
>>> by ps remains constant for all processes.
>>>
>>> Does anyone have any ideas where else I could look to find out
>>> what's
>>> consuming all the RAM on this device?
>>>
>>> _______________________________________________
>>> Lugip mailing list
>>> Lugip at lugip.org
>>> http://www.lugip.org/mailman/listinfo/lugip
>>>
>>> LUG/IP Hardware Sig meets first Tuesday of the month at the
>>> Hamilton Public Library at 7pm
>>>
>>> LUG/IP meets Second Wednesday of the month at the Lawrence
>>> Headquarters Branch of the Mercer County Library at 7pm
>>>
>>> LUG/IP Coffee Klatch meets on the fourth Sunday of the month at
>>> the Panera Bread in West Windsor near Target at 8am
>>>
>>> For more information go to http://www.lugip.org
>>
>
More information about the Lugip
mailing list