NAME
SYNOPSIS
DESCRIPTION
MEMORY STATISTICS PRINT OPTIONS
COPYRIGHT
SEE ALSO
memkind_arena - jemalloc arena allocation memkind operations.
Note: This is EXPERIMENTAL API. The functionality and the header file
itself can be changed (including non-backward compatible changes) or removed.
int memkind_arena_create(struct memkind *kind, struct memkind_ops *ops, const char *name);
int memkind_arena_create_map(struct memkind *kind, extent_hooks_t *hooks);
int memkind_arena_destroy(struct memkind *kind);
void *memkind_arena_malloc(struct memkind *kind, size_t size);
void *memkind_arena_calloc(struct memkind *kind, size_t num, size_t size);
int memkind_arena_posix_memalign(struct memkind *kind, void **memptr, size_t alignment, size_t size);
void *memkind_arena_realloc(struct memkind *kind, void *ptr, size_t size);
void *memkind_arena_realloc_with_kind_detect(void *ptr, size_t size);
int memkind_thread_get_arena(struct memkind *kind, unsigned int *arena, size_t size);
int memkind_bijective_get_arena(struct memkind *kind, unsigned int *arena, size_t size);
struct memkind *get_kind_by_arena(unsigned arena_ind);
struct memkind *memkind_arena_detect_kind(void *ptr);
int memkind_arena_finalize(struct memkind *kind);
void memkind_arena_init(struct memkind *kind);
void memkind_arena_free(struct memkind *kind, void *ptr);
void memkind_arena_free_with_kind_detect(void *ptr);
int memkind_arena_update_memory_usage_policy(struct memkind *kind, memkind_mem_usage_policy policy);
int memkind_arena_set_max_bg_threads(size_t threads_limit);
int memkind_arena_set_bg_threads(bool state);
int memkind_arena_stats_print(void (*write_cb) (void *, const char *), void *cbopaque, memkind_stat_print_opt opts);
This header file is a collection of functions can be used to populate the memkind operations structure for memory kinds that use jemalloc.
memkind_arena_create()
memkind_default_create()
(see memkind_default(3)
) followed by
memkind_arena_create_map()
described below.memkind_arena_create_map()
ops.get_arena()
function from the kind’s operations. If get_arena points
memkind_thread_get_arena()
then there will be four arenas created for each processor
and if get_arena points to memkind_bijective_get_arena()
then just one arena is created.memkind_arena_destroy()
memkind_arena_create()
.memkind_arena_malloc()
memkind_arena_create()
through the
jemalloc’s mallocx()
interface. It uses the memkind “get_arena” operation to select the arena.memkind_arena_calloc()
memkind_arena_create()
through the
jemalloc’s mallocx()
interface. It uses the memkind “get_arena” operation to select the arena.memkind_arena_posix_memalign()
mallocx()
interface. It uses the memkind “get_arena” operation to select
the arena. The POSIX standard requires that posix_memalign(3)
may not set errno however
the jemalloc’s malocx()
routine may. In an attempt to abide by the standard errno is
recorded before calling jemalloc’s mallocx()
and then reset after the call.memkind_arena_realloc()
memkind_arena_create()
through the
jemalloc’s mallocx()
interface. It uses the memkind “get_arena” operation to select the arena.memkind_arena_realloc_with_kind_detect()
memkind_arena_realloc()
or memkind_default_realloc()
.memkind_thread_get_arena()
mallocx()
.memkind_bijective_arena_get_arena()
mallocx()
. Use of this operation implies that only one arena is used for
the kind.memkind_arena_free()
memkind_arena_malloc()
, memkind_arena_calloc()
or
memkind_arena_realloc()
to be made available for future allocations. It uses the memkind
“get_arena” operation to select the arena.memkind_arena_free_with_kind_detect()
memkind_arena_free()
.memkind_arena_detect_kind()
get_kind_by_arena()
memkind_arena_finalize()
memkind_arena_create()
and it’s called when
main() finishes or after calling exit() function.memkind_arena_init()
memkind_arena_update_memory_usage_policy()
memkind_arena_set_max_bg_threads()
sets the maximum number of internal background worker threads in jemalloc. The threads_limit
specify limit of background threads which can be enabled (0 means no limit).
memkind_arena_set_bg_threads()
enables/disables internal background worker threads in jemalloc.
memkind_arena_stats_print()
je_malloc_stats_print()
.
Uses write_cb function to print the output. While providing custom writer function,
use syscall(2)
rather than write(2)
Pass NULL in order to use the default write_cb
function which prints the output to the stderr. Use cbopaque parameter in order to pass
some data to your write_cb function. Pass additional options using opts. For more details
on opts see the MEMORY STATISTICS PRINT OPTIONS section below. Returns
MEMKIND_ERROR_INVALID when failed to parse options string, MEMKIND_SUCCESS on success.The available options for printing statistics:
Copyright (C) 2014 - 2022 Intel Corporation. All rights reserved.
memkind(3), memkind_default(3), memkind_hbw(3), memkind_hugetlb(3), memkind_pmem(3), jemalloc(3), mbind(2), mmap(2), syscall(2), write(2)
The contents of this web site and the associated GitHub repositories are BSD-licensed open source.