ibraheemdev/seize

★ 481⑂ 0

Fast, efficient, and robust memory reclamation for Rust.

About ibraheemdev/seize

ibraheemdev/seize is an open-source project on GitHub, mainly written in Rust. Fast, efficient, and robust memory reclamation for Rust. It currently holds 481 stars and 0 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Agent Memory board.

GitHub Repository Details

Repository ibraheemdev/seize · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

seize

https://github.com/ibraheemdev/seize/blob/HEAD/crates.io https://github.com/ibraheemdev/seize/blob/HEAD/github https://github.com/ibraheemdev/seize/blob/HEAD/docs.rs

Fast, efficient, and predictable memory reclamation for concurrent data structures.

Refer to the [quick-start guide] to get started.

Background

Concurrent data structures are faced with the problem of deciding when it is safe to free memory. Despite an object being logically removed, it may still be accessible by other threads that are holding references to it, and thus it is not safe to free immediately. Over the years, many algorithms have been devised to solve this problem. However, most traditional memory reclamation schemes make a tradeoff between performance and efficiency.

For example, [hazard pointers] track individual pointers, making them very memory efficient but also relatively slow. On the other hand, [epoch based reclamation] is fast and lightweight, but lacks predictability, requiring periodic checks to determine when it is safe to free memory. This can cause reclamation to trigger unpredictably, leading to poor latency distributions.

Alternative epoch-based schemes forgo workload balancing, relying on the thread that retires an object always being the one that frees it. While this can avoid synchronization costs, it also leads to unbalanced reclamation in read-dominated workloads; parallelism is reduced when only a fraction of threads are writing, degrading memory efficiency as well as performance.

Implementation

seize is based on the [hyaline reclamation scheme], which uses reference counting to determine when it is safe to free memory. However, unlike traditional reference counting schemes where every memory access requires modifying shared memory, reference counters are only used for retired objects. When a batch of objects is retired, a reference counter is initialized and propagated to all active threads. Threads cooperate to decrement the reference counter as they exit, eventually freeing the batch. Reclamation is naturally balanced as the thread with the last reference to an object is the one that frees it. This also removes the need to check whether other threads have made progress, leading to predictable latency without sacrificing performance.

seize provides performance competitive with that of epoch based schemes, while memory efficiency is similar to that of hazard pointers. seize is compatible with all modern hardware that supports single-word atomic operations such as FAA and CAS.

[quick-start guide]: https://docs.rs/seize/latest/seize/guide/index.html [hazard pointers]: https://www.cs.otago.ac.nz/cosc440/readings/hazard-pointers.pdf [hyaline reclamation scheme]: https://arxiv.org/pdf/1905.07903.pdf [epoch based reclamation]: https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-579.pdf

GitHub Stars & Activity

481Stars
0Forks
0Open issues
RustLanguage

GitHub Popularity

GitHub stars481
Forks0
Open issues0
Primary languageRust
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

samvallad33 / vestige

Rust★ 628⑂ 0
2

mmtk / mmtk-core

Rust★ 513⑂ 0
3

huggingface / funes

Rust★ 458⑂ 0
4

JordyZomer / lemmalog

Rust★ 316⑂ 0
5

thedotmack / claude-mem

TypeScript★ 94,340⑂ 0
6

mem0ai / mem0

Python★ 65,719⑂ 0
7

volcengine / OpenViking

Python★ 38,212⑂ 0
8

topoteretes / cognee

Python★ 30,864⑂ 0

More AI Rankings