High performance C++ framework for concurrent servers
Classes | Functions | Variables
seastar::memory Namespace Reference

Detailed Description

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.


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...


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_injectorlocal_failure_injector ()
void on_alloc_point ()


thread_local alloc_failure_injector the_alloc_failure_injector

Class Documentation

◆ seastar::memory::memory_layout

struct seastar::memory::memory_layout
Class Members
uintptr_t end
uintptr_t start

Function Documentation

◆ min_free_memory()

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.

◆ set_large_allocation_warning_threshold()

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.

thresholdsize (in bytes) above which an allocation will be logged