65
Volatile Libraries
Volatile libraries are typically simpler to use because they can fall back to dynamic
random-access memory (DRAM) when persistent memory is not available. This
provides a more straightforward implementation. Depending on the workload, they may
also have lower overall overhead compared to similar persistent libraries because they
do not need to ensure consistency of data in the presence of failures.
This section explores the available libraries for volatile use cases in applications,
including what the library is and when to use it. The libraries may have overlapping
situation use cases.
libmemkind
What is it?
The memkind library, called libmemkind, is a user-extensible heap manager built
on top of jemalloc. It enables control of memory characteristics and partitioning of the
heap between different kinds of memory. The kinds of memory are defined by operating
system memory policies that have been applied to virtual address ranges. Memory
characteristics supported by memkind without user extension include control of
nonuniform memory access (NUMA) and page size features. The jemalloc nonstandard
interface has been extended to enable specialized kinds to make requests for virtual
memory from the operating system through the memkind partition interface. Through
the other memkind interfaces, you can control and extend memory partition features
and allocate memory while selecting enabled features. The memkind interface allows
you to create and control file-backed memory from persistent memory with PMEM kind.
Chapter 10 describes this library in more detail. You can download memkind and
read the architecture specification and API documentation at http://memkind.github.
io/memkind/. memkind is an open source project on GitHub at https://github.com/
memkind/memkind.
When to use it?
Choose libmemkind when you want to manually move select memory objects to
persistent memory in a volatile application while retaining the traditional programming
model. The memkind library provides familiar malloc() and free() semantics. This is
the recommended memory allocator for most volatile use cases of persistent memory.
Chapter 5 IntroduCIng the persIstent MeMory developMent KIt
Volatile Libraries
Volatile libraries are typically simpler to use because they can fall back to dynamic
random-access memory (DRAM) when persistent memory is not available. This
provides a more straightforward implementation. Depending on the workload, they may
also have lower overall overhead compared to similar persistent libraries because they
do not need to ensure consistency of data in the presence of failures.
This section explores the available libraries for volatile use cases in applications,
including what the library is and when to use it. The libraries may have overlapping
situation use cases.
libmemkind
What is it?
The memkind library, called libmemkind, is a user-extensible heap manager built
on top of jemalloc. It enables control of memory characteristics and partitioning of the
heap between different kinds of memory. The kinds of memory are defined by operating
system memory policies that have been applied to virtual address ranges. Memory
characteristics supported by memkind without user extension include control of
nonuniform memory access (NUMA) and page size features. The jemalloc nonstandard
interface has been extended to enable specialized kinds to make requests for virtual
memory from the operating system through the memkind partition interface. Through
the other memkind interfaces, you can control and extend memory partition features
and allocate memory while selecting enabled features. The memkind interface allows
you to create and control file-backed memory from persistent memory with PMEM kind.
Chapter 10 describes this library in more detail. You can download memkind and
read the architecture specification and API documentation at http://memkind.github.
io/memkind/. memkind is an open source project on GitHub at https://github.com/
memkind/memkind.
When to use it?
Choose libmemkind when you want to manually move select memory objects to
persistent memory in a volatile application while retaining the traditional programming
model. The memkind library provides familiar malloc() and free() semantics. This is
the recommended memory allocator for most volatile use cases of persistent memory.
Chapter 5 IntroduCIng the persIstent MeMory developMent KIt
