LiJian, On Mon, Feb 25, 2008 at 2:33 PM, 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
I believe mtmalloc behaves exactly the same as the default malloc subsystem in this regard: in both cases, the free() call will not release the physical memory back to OS - otherwise the (mt)malloc/free call will be very expensive (i.e. slow). Tao _______________________________________________ dtrace-discuss mailing list [email protected]
