Is it safe to mix jemalloc with glibc malloc?

Jokea tfengjun at gmail.com
Tue Feb 28 00:34:13 PST 2012


Hi,

I want to configure jemalloc to use mmap with disk backed file, and use 
malloc
for system memory.

1. compile jemalloc with "je_" prefix and with "--enable-swap",
2. in my application:
...
void *big = je_malloc(10000);
void *small = malloc(10);
...
je_free(big);
free(small);
...

There are plenty of small objects which will be freed soon, so I want to 
use the real
memory for these temp objects to improve performance. Is it safe to mix 
je_malloc and malloc?


Thanks,
Jokea



More information about the jemalloc-discuss mailing list