why jemalloc expand virtual memory space so quickly

Ma, Bo bma at websense.com
Thu Aug 4 00:26:23 PDT 2011


Thanks Jason,I will have a try.

-----Original Message-----
From: Jason Evans [mailto:jasone at canonware.com] 
Sent: Thursday, August 04, 2011 3:18 PM
To: Ma, Bo
Cc: jemalloc-discuss at canonware.com
Subject: Re: why jemalloc expand virtual memory space so quickly

On 08/03/2011 11:52 PM, Ma, Bo wrote:
> It seems that gemalloc costs more virtual memory than glibc_malloc.
>
> We are estimating the possibility that replace glibc_malloc by 
> jemalloc.We have seen that jemalloc is really
>
> faster than glibc_malloc and costs less physical memory.But the amount 
> of virtual memory increase quickly.
>
> Though we ends our test,it still occupies many virtual memory.
>
> Because we have more physical memory than 4G but we are still using 
> 32bit Linux,virtual memory is also badly needed.
>
> Is there any way to reduce the virtual memory cost of jemalloc?

Virtual memory is not of major concern on 64-bit systems, and even on 32-bit systems, jemalloc typically works fine for applications that malloc less than 2 GiB of memory.  In any case, here are some things you can do to reduce virtual memory usage:

* Reduce the number of arenas.  If your application is multi-threaded, then multiple arenas are utilized.  This can dramatically increase virtual memory consumption.

* Reduce the chunk size.  This will increase the odds that chunks can be completely unmapped after memory usage decreases.  In practice, whether this helps is rather dependent on application allocation patterns, and small chunk sizes can degrade throughput.

See the jemalloc man page for details on how to control these and other options.

Jason


 To report this as spam, please forward to spam at websense.com.  Thank you.


 Protected by Websense Hosted Email Security -- www.websense.com 



More information about the jemalloc-discuss mailing list