Commit 57983d0
committed
MemoryStore now uses fixed memory pool per store
MemoryStore now pre-allocates max_bytes from the eviction policy,
then installs a custom allocator in that pool that the store will
use. In testing, memory fragmentation appears to have dropped
significantly, significantly decreased the number of sys-calls
managing memory and slightly reduced user time.
In addition, we remove two full copies of our data when we store
it in the memory store.
This PR also adds two new crates (likely to be published).
"Heap Allocator"
Fixed heap allocator based on the TLSF (Two-Level Segregated
Fit) algorithm. TLSF is a fast, constant-time memory allocation
algorithm designed for real-time applications. It organizes free
memory into segregated lists based on block sizes, allowing for
quick allocation and deallocation with minimal fragmentation.
"Alloc Bytes"
Provides custom byte buffers allocated using a user-provided
allocator. It offers both mutable and immutable byte buffers,
enabling efficient memory allocation strategies in systems with
custom memory requirements.
closes: #2891 parent fc85156 commit 57983d0
File tree
17 files changed
+1385
-162
lines changed- external-crates
- alloc-bytes
- src
- heap-allocator
- src
- nativelink-config/examples
- nativelink-store
- src
- tests
- nativelink-util/src
17 files changed
+1385
-162
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments