bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incorrect malloc_stats output


From: Prem Gopalan
Subject: Re: incorrect malloc_stats output
Date: Tue, 19 Aug 2003 10:45:53 -0400 (EDT)

> Yes, _this_ is expected.  First, foreign sbrk()s are counted as system
> memory:
> 
>       /* Count foreign sbrk as system_mem.  */
>       if (old_size)
>       av->system_mem += brk - old_end;

I've no sbrks() in my test program. Shd I still expect foreign sbrks() ?
In anycase, I guess it doesnt concern this bug, but is good to know.
 
> Second, the main arena can also be extended beyond TASK_UNMAPPED_BASE
> using mmap.  This is a feature of Doug Lea's malloc-2.7.0 which I did
> not disable.  So, the main arena can exceed 1GB.

OK. 

> 
> > However, the above is independent of the bug. malloc_stats actually ends
> > up  going to 4.5GB or so on my 4GB box. The Total below of 3.67Gb is 
> > ridiculous as user space ends at 3GB. 
> 
> _That_ indeed looks bogus.  Can you send me your test program?

Test program attached. FYI, the program gradually tries to allocate more
3GB, but if you watch it gradually increase size of main arena > ~900MB
(when it crosses the real sbrk limit) this jump in memory usage happens -- 
which is bogus. As "top" at this point only report about 1.6GB.

Arena 0:
system bytes     =  829345852
in use bytes     =  829344180
Arena 1:
system bytes     =  466952192
in use bytes     =  466938760
Total (incl. mmap):
system bytes     = 1418317884
in use bytes     = 1418302780
max mmap regions =         15
max mmap bytes   =  122019840

Arena 0:
system bytes     = 1536147516       <----- JUMP
in use bytes     = 1536123292
Arena 1:
system bytes     =  466952192
in use bytes     =  466939944
Total (incl. mmap):
system bytes     = 2125119548        <----- top says 1.6GB
in use bytes     = 2125083076
max mmap regions =         15
max mmap bytes   =  122019840

Thanks,
Prem.

Attachment: pthreadex.cc
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]