memtx: use MemtxAllocator stats for box.info.memory
We need MemtxAllocator stats for reporting read view memory usage, see https://github.com/tarantool/tarantool-ee/issues/143. Let's also use them for reporting data memory usage in box.info.memory() for consistency and add a test. It looks more correct that using allocator stats for reporting data memory usage because box.info.memory() is supposed to show high level stats. For low level allocator stats we have box.slab.info(). Note that a memtx tuple may be held by tuple_bless so we have to reset it by creating a new tuple in Lua before checking memory usage. NO_DOC=refactoring NO_CHANGELOG=refactoring
Showing
- src/box/memtx_allocator.cc 1 addition, 2 deletionssrc/box/memtx_allocator.cc
- src/box/memtx_engine.cc 3 additions, 5 deletionssrc/box/memtx_engine.cc
- test/box-luatest/gh_934_memory_info_test.lua 33 additions, 1 deletiontest/box-luatest/gh_934_memory_info_test.lua
- test/box-luatest/memtx_gc_after_snapshot_test.lua 1 addition, 0 deletionstest/box-luatest/memtx_gc_after_snapshot_test.lua
Loading
Please register or sign in to comment