Re: Memory usage per memory zone

From: Wu Fengguang
Date: Wed Mar 11 2009 - 08:26:57 EST


On Wed, Mar 11, 2009 at 02:16:38PM +0200, jack marrow wrote:
> 2009/3/11 Wu Fengguang <fengguang.wu@xxxxxxxxx>:
> > On Wed, Mar 11, 2009 at 01:51:32PM +0200, jack marrow wrote:
> >> 2009/3/11 Wu Fengguang <fengguang.wu@xxxxxxxxx>:
> >> > Hi jack,
> >> >
> >> > On Wed, Mar 11, 2009 at 11:41:43AM +0100, jack marrow wrote:
> >> >> Hello,
> >> >>
> >> >> I have a box where the oom-killer is killing processes due to running
> >> >> out of memory in zone_normal. I can see using slabtop that the inode
> >> >
> >> > How do you know that the memory pressure on zone normal stand out alone?
> >>
> >> For the normal zone only, I see "all_unreclaimable: yes" and 3 megs of free ram:
> >>
> >> kernel: Normal free:2576kB min:3728kB low:7456kB high:11184kB
> >> active:1304kB inactive:128kB present:901120kB pages_scanned:168951
> >> all_unreclaimable? yes
> >
> > It's normal behavior. ÂLinux kernel tries hard to utilize most of
> > the free memory for caching files :)
>
> With all_unreclaimable = yes is normal?

Ah, perhaps not.

Can you paste /proc/vmstat, /proc/meminfo, /proc/zoneinfo and
/proc/slabinfo? Thank you.

> >
> >> >> caches are using up lots of memory and guess this is the problem, so
> >> >> have cleared them using an echo to drop_caches.
> >> >
> >> > It would better be backed by concrete numbers...
> >> >
> >> >>
> >> >> I would quite like to not guess though - is it possible to use slabtop
> >> >> (or any other way) to view ram usage per zone so I can pick out the
> >> >> culprit?
> >> >
> >> > /proc/zoneinfo and /proc/vmstat do have some per-zone numbers.
> >> > Some of them deal with slabs.
> >>
> >> Thanks, I'll read up on how to interpret these.
> >>
> >> Do you recommend these two files for tracking down memory usage per
> >> process per zone?
> >
> > No, the two interfaces provide system wide counters. ÂWe have the well
> > known tools "ps" and "top" for per-process numbers, hehe.
>
> ps and top do not have per-zone numbers. How do I get those?

Maybe through the pagemap interface: Documentation/vm/pagemap.txt

Thanks,
Fengguang

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/