Skip to content
Snippets Groups Projects
Commit 53c0e910 authored by mechanik20051988's avatar mechanik20051988 Committed by Nikita Pettik
Browse files

memxt: add granularity option to box.cfg{}

Granularity is an option that allows user to set
multiplicity of memory allocation in small allocator.
Granulatiry must be exponent of two and >= 4. By default
granularity value == sizeof(intptr_t), as it was before,
when this option was not provided.

@TarantoolBot document
Title: Add 'granularity' option to box.cfg{}
Add granularity option that allows user to set multiplicity
of memory allocation in small allocator. Granularity determines
not only alignment of objects, but also size of the objects in
the pool. Thus, the greater the granularity, the greater the
memory loss per one memory allocation, but tuples with different
sizes are allocated from the same mempool, and we do not lose
memory on the slabs, when we have highly distributed tuple sizes.
This is somewhat similar to a large alloc factor. The smaller the
granularity, the less memory loss per allocation, if the user has
many small tuples of approximately the same size, it will be nice
to set granularity == 4 to save memory.

This option must be set once during start, default value
== sizeof(intptr_t) (8 on 64 bit platforms), as it was before, when
this option was not provided. Granularity must be exponent of two
and >= 4. Together with the slab_alloc_factor, this option gives you
full control over the behavior of small allocator.

Closes #5518
parent 3a7c2102
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment