Hi Jason,

> jemalloc *is* a slab allocator, so you're unlikely to improve the situation 
> much
> by layering a sub-allocator on top of it.  More likely, this change would
> actually increase fragmentation, for the same basic reason that using multiple
> arenas in jemalloc increases fragmentation (available memory within a slab 
> from
> arena 0 is not available to a thread that is assigned to arena 1).

Nice to have someone with experience in the area here. Let me take an 
advantage of that and ask you a question:

Say I am allocating a buffer of 16kB. The allocator may or may not 
prepend it by chunk header. In the former case the actual size of the 
allocated memory will be slightly higher, say 16.1kB. Which means that 
instead of using 3 full pages, it will require one additional, almost 
empty page. Which in turn means higher memory consumption and, possibly, 
fragmentation.

Is there a rule of thumb to prevent such behaviour? Something like: 
always allocated N * page-size - 256 or somesuch?

Martin
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to