mi-malloc: Runtime Options

| mi-malloc 1.8/2.1 |

Loading...
Searching...
No Matches
Enumerations | Functions
Runtime Options

Set runtime behavior. More...

## Enumerations
enum | mi_option_t { mi_option_show_errors , mi_option_show_stats , mi_option_verbose , mi_option_max_errors , mi_option_max_warnings , mi_option_reserve_huge_os_pages , mi_option_reserve_huge_os_pages_at , mi_option_reserve_os_memory , mi_option_allow_large_os_pages , mi_option_purge_decommits , mi_option_arena_reserve , mi_option_os_tag , mi_option_retry_on_oom , mi_option_eager_commit , mi_option_eager_commit_delay , mi_option_arena_eager_commit , mi_option_abandoned_page_purge , mi_option_purge_delay , mi_option_use_numa_nodes , mi_option_disallow_os_alloc , mi_option_limit_os_alloc , mi_option_max_segment_reclaim , mi_option_destroy_on_exit , mi_option_arena_purge_mult , mi_option_abandoned_reclaim_on_free , mi_option_purge_extend_delay , mi_option_disallow_arena_alloc , mi_option_visit_abandoned , _mi_option_last }
| Runtime options. More...

## Functions
bool | mi_option_is_enabled (mi_option_t option)
void | mi_option_enable (mi_option_t option)
void | mi_option_disable (mi_option_t option)
void | mi_option_set_enabled (mi_option_t option, bool enable)
void | mi_option_set_enabled_default (mi_option_t option, bool enable)
long | mi_option_get (mi_option_t option)
long | mi_option_get_clamp (mi_option_t option, long min, long max)
size_t | mi_option_get_size (mi_option_t option)
void | mi_option_set (mi_option_t option, long value)
void | mi_option_set_default (mi_option_t option, long value)

## Detailed Description

Set runtime behavior.

## Enumeration Type Documentation

## ◆ mi_option_t

enum mi_option_t

Runtime options.

Enumerator
mi_option_show_errors | Print error messages.
mi_option_show_stats | Print statistics on termination.
mi_option_verbose | Print verbose messages.
mi_option_max_errors | issue at most N error messages
mi_option_max_warnings | issue at most N warning messages
mi_option_reserve_huge_os_pages | reserve N huge OS pages (1GiB pages) at startup
mi_option_reserve_huge_os_pages_at | Reserve N huge OS pages at a specific NUMA node N.
mi_option_reserve_os_memory | reserve specified amount of OS memory in an arena at startup (internally, this value is in KiB; use `mi_option_get_size`)
mi_option_allow_large_os_pages | allow large (2 or 4 MiB) OS pages, implies eager commit. If false, also disables THP for the process.
mi_option_purge_decommits | should a memory purge decommit? (=1). Set to 0 to use memory reset on a purge (instead of decommit)
mi_option_arena_reserve | initial memory size for arena reservation (= 1 GiB on 64-bit) (internally, this value is in KiB; use `mi_option_get_size`)
mi_option_os_tag | tag used for OS logging (macOS only for now) (=100)
mi_option_retry_on_oom | retry on out-of-memory for N milli seconds (=400), set to 0 to disable retries. (only on windows)
mi_option_eager_commit | eager commit segments? (after `eager_commit_delay` segments) (enabled by default).
mi_option_eager_commit_delay | the first N segments per thread are not eagerly committed (but per page in the segment on demand)
mi_option_arena_eager_commit | eager commit arenas? Use 2 to enable just on overcommit systems (=2)
mi_option_abandoned_page_purge | immediately purge delayed purges on thread termination
mi_option_purge_delay | memory purging is delayed by N milli seconds; use 0 for immediate purging or -1 for no purging at all. (=10)
mi_option_use_numa_nodes | 0 = use all available numa nodes, otherwise use at most N nodes.
mi_option_disallow_os_alloc | 1 = do not use OS memory for allocation (but only programmatically reserved arenas)
mi_option_limit_os_alloc | If set to 1, do not use OS memory for allocation (but only pre-reserved arenas)
mi_option_max_segment_reclaim | max. percentage of the abandoned segments can be reclaimed per try (=10%)
mi_option_destroy_on_exit | if set, release all memory on exit; sometimes used for dynamic unloading but can be unsafe
mi_option_arena_purge_mult | multiplier for `purge_delay` for the purging delay for arenas (=10)
mi_option_abandoned_reclaim_on_free | allow to reclaim an abandoned segment on a free (=1)
mi_option_purge_extend_delay | extend purge delay on each subsequent delay (=1)
mi_option_disallow_arena_alloc | 1 = do not use arena's for allocation (except if using specific arena id's)
mi_option_visit_abandoned | allow visiting heap blocks from abandoned threads (=0)
_mi_option_last |

## Function Documentation

## ◆ mi_option_disable()

void mi_option_disable | ( | mi_option_t | option | ) |

## ◆ mi_option_enable()

void mi_option_enable | ( | mi_option_t | option | ) |

## ◆ mi_option_get()

long mi_option_get | ( | mi_option_t | option | ) |

## ◆ mi_option_get_clamp()

long mi_option_get_clamp | ( | mi_option_t | option,
|  | long | min,
|  | long | max )

## ◆ mi_option_get_size()

size_t mi_option_get_size | ( | mi_option_t | option | ) |

## ◆ mi_option_is_enabled()

bool mi_option_is_enabled | ( | mi_option_t | option | ) |

## ◆ mi_option_set()

void mi_option_set | ( | mi_option_t | option,
|  | long | value )

## ◆ mi_option_set_default()

void mi_option_set_default | ( | mi_option_t | option,
|  | long | value )

## ◆ mi_option_set_enabled()

void mi_option_set_enabled | ( | mi_option_t | option,
|  | bool | enable )

## ◆ mi_option_set_enabled_default()

void mi_option_set_enabled_default | ( | mi_option_t | option,
|  | bool | enable )