You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on the traffic of the chain and interval of snapshot rewriting, memiavl need to manage lots of small memories for MemNodes and key/value slices, which could put a big pressure to golang GC, it might make sense to use some manual memory management.
Memory Arenas
One obvious solution is memory arenas feature introduced in go 1.20, we just allocate these objects with big chunks of arenas.
Negatives
we can't reclaim and reuse memory, arenas don't support deallocating, before dropped as a whole when we switch snapshot, it's maybe alright assuming deletion happens more rarely than insertion/updates.
Manual Memory Management
Implement MemNode as a []byte, similar to the nodes in mmap-ed snapshots, allocate in a big buffer, maintain an intrusive free list to reuse nodes.
Leave key/value slices to golang GC.
The text was updated successfully, but these errors were encountered:
Depending on the traffic of the chain and interval of snapshot rewriting, memiavl need to manage lots of small memories for
MemNode
s and key/value slices, which could put a big pressure to golang GC, it might make sense to use some manual memory management.Memory Arenas
One obvious solution is memory arenas feature introduced in go 1.20, we just allocate these objects with big chunks of arenas.
Negatives
Manual Memory Management
MemNode
as a[]byte
, similar to the nodes in mmap-ed snapshots, allocate in a big buffer, maintain an intrusive free list to reuse nodes.The text was updated successfully, but these errors were encountered: