On Tue, Aug 01, 2006 at 02:01:36PM +0100, James Coleman wrote:
> Jonathan Adams wrote:
> >On Fri, Jul 28, 2006 at 06:24:56PM +0100, James Coleman wrote:
> >>Could someone confirm that I am correct about this that oversize 
> >>allocations are not tracked
> >>in libumem?
> >
> >
> >They are tracked, but in a different way;  you can get all of the oversized
> >allocations by doing:
> >
> >
> >>*umem_oversize_arena::walk vmem_alloc | ::vmem_seg -v
> 
> ohhhh :) more magic.
> 
> That is quite good. We have one module which is doing practically all those
> oversize allocations. That oversized list confirms it is using lots of
> memory but working quite nicely.
> 
> 
> Now out of a 700M process I can see about 50M tracked in ::umausers and 200M
> tracked in oversize. Hmmm. I have 450M still to be acoounted for. You'd 
> think it
> would be easier to see what it was used for!! :)

Remember that there's quite a bit of overhead (typically about 50%) in the
metadata, mostly to store all of the stacks.  You can get a good overview
of where the memory is going using the second section of ::umastat;  the
arenas of interest are:

        sbrk_top        memory requested from sbrk(2).
        sbrk_heap       memory actually in use by umem
        *_internal      memory used for internal metadata
        umem_oversize   memory used for oversized allocations
        umem_memalign   memory used for memalign(3C) allocations
        umem_default    memory used for non-oversized allocations.

There's also some per-buffer overhead;  in Solaris Nevada, I recently putback
some dcmds which analyze that overhead.  See the Description field of:

6304072 libumem seems to use more heap than it needs

for more details.

> I thought I might see C++ stl doing oversize allocations but I don't.
> I suspect that is the guilty party. Not sure ... yet. Getting there though.
> If the missing allocations are not through malloc then it is going to be 
> harder.
> If I truss then I see mmap on process start .... but not much after.
> Actually looks like all the mmap calls are invoked by malloc.
> I see loads of brk calls. Oh dear.
> 
> Hmmm. Maybe I could write a simple mdb script which would break on every 
> brk call, log
> details and continue. I don't know much about mmap or sbrk ...
> I think it's time to find out a bit more.
> 
> 
> >Which dcmds in particular are you using that you'd like oversize support 
> >for?
> 
> I am using ::umausers alot.

I've filed

6455614 ::umausers/::kmausers should include oversized allocations in their 
output

Cheers,
- jonathan


-- 
Jonathan Adams, Solaris Kernel Development

Reply via email to