There are smarter people than me that can go into better detail, but
I'll give it a shot.  All the memory allocators you're usually going
to see grow your address space using brk(1)/sbrk(1).  They generally
don't shrink the address space back down.

If you really need the address space to shrink (the common solution is
just to let those pages get pushed out to the VM), try mmap() on a
temporary file (or /dev/zero, but I donno if that works on solaris)
and allocate memory out of that.  When you're done with that, just
unmap the file and the address space is freed.  GNU malloc does this
in certain situations.


On Mon, Feb 25, 2008 at 1:33 AM, LiJIan <[EMAIL PROTECTED]> wrote:
> Hi,
>   In performance test, my application (multi-thread programme) expriences a 
> memory consumption peak because there are at most e.g. 100 clients 
> communicate with it.  My question is, why after all clients exit, when 
> application has noting to do, according to result of tool "pstack" or "pmap", 
> my application still occupy a big amount of memory ?
>
>  My application use libmtmalloc.so.1 for memory allocation.
>
>  I found description "After free() is executed, this space is made available 
> for further  allocation  by  the application, though not returned to the 
> system. Memory is returned to the system only upon  termination of  the  
> application"
>  in the second paragraph of "malloc"  man page;    and description "After 
> free() is performed this space is available for  further  allocation" in the 
> thrid paragraph of "mtmalloc" man page.
>
>  According to the descriptions, it seems "mtmalloc" is exactly different from 
> "malloc", and if using mtmalloc, after "free()" the consumed memory is 
> returned to system immediately, since in man page of "mtmalloc" it doesn't 
> emphasize the memory is not returned to system after "free()" is called until 
> application termination.  Right ?
>
>  But in our performance test we found "mtmalloc" has the same behaviour with 
> "malloc".
>
>  BR/LiJian
>
>
>  --
>  This message posted from opensolaris.org
>  _______________________________________________
>  dtrace-discuss mailing list
>  [email protected]
>



-- 
H. Lally Singh
Ph.D. Candidate, Computer Science
Virginia Tech
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to