[Lldb-commits] [PATCH] D68549: make ConstString allocate memory in non-tiny chunks
Raphael Isemann via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 15 16:50:09 PDT 2019
teemperor added subscribers: xiaobai, teemperor.
teemperor added a comment.
This patch actually made the RSS memory in our benchmarks go up by quite a bit (see lldb-bench <https://teemperor.de/lldb-bench/static.html> ). The reason is that while we only create 1MiB chunks in the new allocator, we do have 256 different string pools we use as the backend for ConstString. So this means that we actually do allocation steps of 1MiB * 256 = 256MiB which is quite a lot. On a side note, we do use ConstString in the lldb-debugserver, and allocating additional 256MiB on some device running lldb-debugserver could end up being a serious problem if my understanding is correct? (+Alex because IIRC he cares about the debug server memory footprint).
Anyway, I think we either make the slab allocation logic smarter than just creating 1MiB slabs and trust the kernel/libc to not actually allocate that much real memory (maybe something like the std::vector growth model) or we fix the fact that we always have 256 string pools.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68549/new/
https://reviews.llvm.org/D68549
More information about the lldb-commits
mailing list