Skip to content

Commit 0c5e25b

Browse files
authored
Use tikv-jemallocator instead of jemallocator (#6354)
* Use tikv-jemallocator instead of jemallocator * Merge branch 'unstable' into tikv-jemallocator * Bump tikv-jemallocator and tikv-jemalloc-ctl
1 parent c824142 commit 0c5e25b

File tree

4 files changed

+43
-41
lines changed

4 files changed

+43
-41
lines changed

.cargo/config.toml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[env]
22
# Set the number of arenas to 16 when using jemalloc.
33
JEMALLOC_SYS_WITH_MALLOC_CONF = "abort_conf:true,narenas:16"
4-

Cargo.lock

+33-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/malloc_utils/Cargo.toml

+8-5
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ edition = { workspace = true }
88
lighthouse_metrics = { workspace = true }
99
libc = "0.2.79"
1010
parking_lot = { workspace = true }
11-
jemalloc-ctl = { version = "0.5.0", optional = true }
11+
tikv-jemalloc-ctl = { version = "0.6.0", optional = true, features = ["stats"] }
1212

1313
# Jemalloc's background_threads feature requires Linux (pthreads).
1414
[target.'cfg(target_os = "linux")'.dependencies]
15-
jemallocator = { version = "0.5.0", optional = true, features = ["stats", "background_threads"] }
15+
tikv-jemallocator = { version = "0.6.0", optional = true, features = [
16+
"stats",
17+
"background_threads",
18+
] }
1619

1720
[target.'cfg(not(target_os = "linux"))'.dependencies]
18-
jemallocator = { version = "0.5.0", optional = true, features = ["stats"] }
21+
tikv-jemallocator = { version = "0.6.0", optional = true, features = ["stats"] }
1922

2023
[features]
2124
mallinfo2 = []
22-
jemalloc = ["jemallocator", "jemalloc-ctl"]
23-
jemalloc-profiling = ["jemallocator/profiling"]
25+
jemalloc = ["tikv-jemallocator", "tikv-jemalloc-ctl"]
26+
jemalloc-profiling = ["tikv-jemallocator/profiling"]

common/malloc_utils/src/jemalloc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
//!
88
//! A) `JEMALLOC_SYS_WITH_MALLOC_CONF` at compile-time.
99
//! B) `_RJEM_MALLOC_CONF` at runtime.
10-
use jemalloc_ctl::{arenas, epoch, stats, Error};
1110
use lighthouse_metrics::{set_gauge, try_create_int_gauge, IntGauge};
1211
use std::sync::LazyLock;
12+
use tikv_jemalloc_ctl::{arenas, epoch, stats, Error};
1313

1414
#[global_allocator]
15-
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
15+
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
1616

1717
// Metrics for jemalloc.
1818
pub static NUM_ARENAS: LazyLock<lighthouse_metrics::Result<IntGauge>> =

0 commit comments

Comments
 (0)