-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core/memory: Introduce heap profiler
Records allocation sites and sizes so that it's later possible to see what kind of objects are taking up space on the heap. Adds 8 bytes of memory overhead per live object when compiled-in. Not compiled-in by default. To do so, configure with SEASTAR_HEAPPROF: ./configure.py --cflags=-DSEASTAR_HEAPPROF To enable recording allocation sites, start seastar application with the --heapprof flag: build/release/memcached --heapprof It is possible to enable recording in run-time using, for instance, a RESTful API. scylla-gdb.py support will follow, with text-mode tree presentation and dumping to flamegraphs. Flamegraph example: https://cloud.githubusercontent.com/assets/283695/18888026/f69fc4e6-84f6-11e6-9b7b-305667d30f52.png Text example: (gdb) scylla heapprof -r All (275954028, #12783) |-- void* memory::cpu_pages::allocate_large_and_trim<memory::cpu_pages::allocate_large_aligned(unsigned int, unsigned int)::{lambda(unsigned int, unsigned int)#1}>(unsigned int, memory::cpu_pages::allocate_large_aligned(unsigned int, unsigned int)::{lambda(unsigned int, unsigned int)#1}) + 169 (268959744, #5) | memory::allocate_large_aligned(unsigned long, unsigned long) + 87 | |-- logalloc::segment_zone::segment_zone() + 291 (268435456, #1) | | logalloc::segment_pool::allocate_segment() + 413 | | logalloc::segment_pool::segment_pool() + 296 | | __tls_init.part.787 + 72 | | logalloc::region_group::release_requests() + 1333 | | logalloc::region_group::add(logalloc::region_group*) + 514 | | database::database(db::config const&) + 4246 | | (...) | | | \-- memory::allocate_aligned(unsigned long, unsigned long) + 13 (524288, #4) | |-- memalign + 9 (262144, #2) | | db::commitlog::segment_manager::acquire_buffer(unsigned long) + 90 | | db::commitlog::segment::new_buffer(unsigned long) + 113 | | db::commitlog::segment::allocate(utils::UUID const&, shared_ptr<db::commitlog::entry_writer>) + 2347 | | |-- db::commitlog::add_entry(utils::UUID const&, commitlog_entry_writer const&) + 1620 (131072, #1) | | | database::do_apply(lw_shared_ptr<schema const>, frozen_mutation const&) + 182 | | | database::apply(lw_shared_ptr<schema const>, frozen_mutation const&) + 235 | | | service::storage_proxy::mutate_locally(lw_shared_ptr<schema const> const&, frozen_mutation const&) + 434 Message-Id: <[email protected]>
- Loading branch information
Showing
3 changed files
with
234 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.