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
Showing
- changelogs/unreleased/add-granularity-option.md 5 additions, 0 deletionschangelogs/unreleased/add-granularity-option.md
- src/box/box.cc 26 additions, 0 deletionssrc/box/box.cc
- src/box/lua/load_cfg.lua 2 additions, 0 deletionssrc/box/lua/load_cfg.lua
- src/box/memtx_engine.c 3 additions, 2 deletionssrc/box/memtx_engine.c
- src/box/memtx_engine.h 3 additions, 3 deletionssrc/box/memtx_engine.h
- src/box/tuple.c 2 additions, 1 deletionsrc/box/tuple.c
- src/lib/small 1 addition, 1 deletionsrc/lib/small
- src/trivia/util.h 7 additions, 0 deletionssrc/trivia/util.h
- test/app-tap/init_script.result 1 addition, 0 deletionstest/app-tap/init_script.result
- test/box/admin.result 2 additions, 0 deletionstest/box/admin.result
- test/box/cfg.result 4 additions, 0 deletionstest/box/cfg.result
- test/box/gh-5518-add-granularity-option.lua 20 additions, 0 deletionstest/box/gh-5518-add-granularity-option.lua
- test/box/gh-5518-add-granularity-option.result 144 additions, 0 deletionstest/box/gh-5518-add-granularity-option.result
- test/box/gh-5518-add-granularity-option.test.lua 80 additions, 0 deletionstest/box/gh-5518-add-granularity-option.test.lua
Loading
Please register or sign in to comment