Excerpt |
---|
This article covers the internal design of Durable Memory. Intended for Ignite developers. The reasoning behind the durable memory is described in the main documentation: https://apacheignite.readme.io/docs/durable-memory |
Table of Contents |
---|
Let's split the memory into pages (synonyms: buffers, block, chunks). Let's consider the Page as a fundamental unit the whole memory is split into. This makes the memory addressing page-based.
...
Read lock is held to segment to resolve real unmanaged memory address from page ID (page pin). Write lock is held if segment pages are being modified (e.g. page is rotated from RAM to disk).
This section describes possible pages and entries operations related to rotation with disk or completely removal data from grid.
Term | Activated | Comments | Configuration | Level of operation | In memory only mode | Persistency mode |
---|---|---|---|---|---|---|
Expiration (aka TTL) | Time | Sets expire time of entry after... | ExpiryPolicy (Factory) | Entry | ||
Eviction | Region is full | Completely removes entry from grid. Reasonable with 3rd party persistence | PageEvictionMode | Entry (+ page is used to find more entries to remove) | N/A | |
On Heap eviction | Depends on policy | Near caches and On-Heap caches (1.x) | LruEvictionPolicy | Entry | only for near /on-heap caches | |
Page replacement | Region is full | Ignite operates | Not configurable by user | Page | N/A | Always enabled |
...
This policy solves case of one-time access of data, for example, one full scan query. Pages touched during running this query is not considered hot. See also documentation
Ignite manages free lists to solve issue with fragmentation in pages (not full pages).
...
If object is longer than page size, it will require several pages to store
...
Hash Index is also B+ Tree (not hash table), key is hashcode and value is link.
DataRegionConfiguration (historical naming is Memory Policy) is especially important when Ignite Persistent Store configuration is enabled.
...
Reference tables (dictionaries) are usually small, and may be assigned to be allocated to memory always.
...
Following paragraph summarizes results of memory structure changes
For previous Ignite versions - caches were on heap by default. Offheap caches were required configuration, and a number of small regions were allocated for each usage.
...