Seastar
High performance C++ framework for concurrent servers
|
Low-level memory management support
The memory
namespace provides functions and classes for interfacing with the seastar memory allocator.
The seastar memory allocator splits system memory into a pool per logical core (lcore). Memory allocated one an lcore should be freed on the same lcore; failing to do so carries a severe performance penalty. It is possible to share memory with another core, but this should be limited to avoid cache coherency traffic.
Classes | |
class | alloc_failure_injector |
struct | disable_failure_guard |
struct | memory_layout |
class | scoped_large_allocation_warning_disable |
Disable large allocation warnings for a scope. More... | |
class | scoped_large_allocation_warning_threshold |
Set a different large allocation warning threshold for a scope. More... | |
class | statistics |
Memory allocation statistics. More... | |
Functions | |
statistics | stats () |
Capture a snapshot of memory allocation statistics for this lcore. | |
memory::memory_layout | get_memory_layout () |
size_t | min_free_memory () |
void | set_min_free_pages (size_t pages) |
Sets the value of free memory low water mark in memory::page_size units. | |
void | set_large_allocation_warning_threshold (size_t threshold) |
size_t | get_large_allocation_warning_threshold () |
Gets the current large allocation warning threshold. | |
void | disable_large_allocation_warning () |
Disable large allocation warnings. | |
alloc_failure_injector & | local_failure_injector () |
void | on_alloc_point () |
Variables | |
thread_local alloc_failure_injector | the_alloc_failure_injector |
size_t seastar::memory::min_free_memory | ( | ) |
Returns the value of free memory low water mark in bytes. When free memory is below this value, reclaimers are invoked until it goes above again.
void seastar::memory::set_large_allocation_warning_threshold | ( | size_t | threshold | ) |
Enable the large allocation warning threshold.
Warn when allocation above a given threshold are performed.
threshold | size (in bytes) above which an allocation will be logged |