vii
Chapter 9: pmemkv: A Persistent In- Memory Key-Value Store ���������������������������� 141
pmemkv Architecture ���������������������������������������������������������������������������������������������������������������� 143
A Phonebook Example �������������������������������������������������������������������������������������������������������������� 147
Bringing Persistent Memory Closer to the Cloud ���������������������������������������������������������������������� 151
Summary����������������������������������������������������������������������������������������������������������������������������������� 152
Chapter 10: Volatile Use of Persistent Memory ���������������������������������������������������� 155
Introduction ������������������������������������������������������������������������������������������������������������������������������� 155
Background ������������������������������������������������������������������������������������������������������������������������������� 156
Memory Allocation ��������������������������������������������������������������������������������������������������������������� 156
How it Works ����������������������������������������������������������������������������������������������������������������������� 156
Supported “Kinds” of Memory ��������������������������������������������������������������������������������������������� 157
The memkind API ���������������������������������������������������������������������������������������������������������������������� 159
Kind Management API ��������������������������������������������������������������������������������������������������������� 159
Heap Management API �������������������������������������������������������������������������������������������������������� 164
Kind Configuration Management ����������������������������������������������������������������������������������������� 167
Additional memkind Code Examples ����������������������������������������������������������������������������������� 168
C++ Allocator for PMEM Kind ��������������������������������������������������������������������������������������������������� 168
pmem::allocator methods ���������������������������������������������������������������������������������������������������� 169
Nested Containers ��������������������������������������������������������������������������������������������������������������� 169
C++ Examples �������������������������������������������������������������������������������������������������������������������������� 170
Using the pmem::allocator �������������������������������������������������������������������������������������������������� 170
Creating a Vector of Strings ������������������������������������������������������������������������������������������������� 171
Expanding Volatile Memory Using Persistent Memory �������������������������������������������������������������� 173
libvmemcache: An Efficient Volatile Key-Value Cache for Large-Capacity
Persistent Memory �������������������������������������������������������������������������������������������������������������������� 177
libvmemcache Overview ����������������������������������������������������������������������������������������������������� 178
libvmemcache Design ��������������������������������������������������������������������������������������������������������� 180
Using libvmemcache ����������������������������������������������������������������������������������������������������������� 183
Summary����������������������������������������������������������������������������������������������������������������������������������� 186
Table of ConTenTs
Chapter 9: pmemkv: A Persistent In- Memory Key-Value Store ���������������������������� 141
pmemkv Architecture ���������������������������������������������������������������������������������������������������������������� 143
A Phonebook Example �������������������������������������������������������������������������������������������������������������� 147
Bringing Persistent Memory Closer to the Cloud ���������������������������������������������������������������������� 151
Summary����������������������������������������������������������������������������������������������������������������������������������� 152
Chapter 10: Volatile Use of Persistent Memory ���������������������������������������������������� 155
Introduction ������������������������������������������������������������������������������������������������������������������������������� 155
Background ������������������������������������������������������������������������������������������������������������������������������� 156
Memory Allocation ��������������������������������������������������������������������������������������������������������������� 156
How it Works ����������������������������������������������������������������������������������������������������������������������� 156
Supported “Kinds” of Memory ��������������������������������������������������������������������������������������������� 157
The memkind API ���������������������������������������������������������������������������������������������������������������������� 159
Kind Management API ��������������������������������������������������������������������������������������������������������� 159
Heap Management API �������������������������������������������������������������������������������������������������������� 164
Kind Configuration Management ����������������������������������������������������������������������������������������� 167
Additional memkind Code Examples ����������������������������������������������������������������������������������� 168
C++ Allocator for PMEM Kind ��������������������������������������������������������������������������������������������������� 168
pmem::allocator methods ���������������������������������������������������������������������������������������������������� 169
Nested Containers ��������������������������������������������������������������������������������������������������������������� 169
C++ Examples �������������������������������������������������������������������������������������������������������������������������� 170
Using the pmem::allocator �������������������������������������������������������������������������������������������������� 170
Creating a Vector of Strings ������������������������������������������������������������������������������������������������� 171
Expanding Volatile Memory Using Persistent Memory �������������������������������������������������������������� 173
libvmemcache: An Efficient Volatile Key-Value Cache for Large-Capacity
Persistent Memory �������������������������������������������������������������������������������������������������������������������� 177
libvmemcache Overview ����������������������������������������������������������������������������������������������������� 178
libvmemcache Design ��������������������������������������������������������������������������������������������������������� 180
Using libvmemcache ����������������������������������������������������������������������������������������������������������� 183
Summary����������������������������������������������������������������������������������������������������������������������������������� 186
Table of ConTenTs
