Fix a bug with wrong defaults when initializing the small object allocator.
tuple.cc passed wrong parameters to small_alloc_create - prealloc size instead of slab size, and slab size instead of prealloc size. When correct parameters were supplied, it turned out that objsize_max is calculated wrongly, and the last factor pool in small allocator is too framgented (uses 3 empty slots instead of 4, with 25% overhead). The problem would not show up in any test, only increase memory fragmentation. This patch also fixes this problem.
Showing
- src/box/tuple.cc 4 additions, 6 deletionssrc/box/tuple.cc
- src/lib/small/mempool.h 12 additions, 0 deletionssrc/lib/small/mempool.h
- src/lib/small/small.c 10 additions, 12 deletionssrc/lib/small/small.c
- src/lib/small/small.h 2 additions, 2 deletionssrc/lib/small/small.h
- test/unit/small_alloc.c 1 addition, 2 deletionstest/unit/small_alloc.c
- test/wal/oom.result 14 additions, 14 deletionstest/wal/oom.result
Loading
Please register or sign in to comment