Skip to content

Commit 7eae1b4

Browse files
genezhangclaude
andauthored
perf: use jemalloc to prevent memory fragmentation (#201)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 20ac201 commit 7eae1b4

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ async-trait = "0.1"
4949
# chdb: embedded ClickHouse (optional — only compiled when feature "embedded" is enabled)
5050
chdb-rust = { version = "1.3.0", optional = true }
5151

52+
[target.'cfg(not(target_env = "msvc"))'.dependencies]
53+
tikv-jemallocator = { version = "0.6", optional = true }
54+
5255
[features]
53-
default = []
56+
default = ["jemalloc"]
57+
jemalloc = ["tikv-jemallocator"]
5458
embedded = ["chdb-rust"]
5559

5660
[dev-dependencies]

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#[cfg(feature = "jemalloc")]
2+
#[global_allocator]
3+
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
4+
15
use clap::Parser;
26
use clickgraph::{config, server};
37

0 commit comments

Comments
 (0)