Skip to content

Commit 1de179e

Browse files
authored
chore(deps): update jemallocator 0.5 to tikv-jemallocator 0.6 (#4012)
tikv-jemallocator supersedes jemallocator. To enable jemalloc profiling, this change updates the dependency and adds a `jemalloc-profiling` feature so that profiling can be enabled at build time.
1 parent f9d7e08 commit 1de179e

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

Cargo.lock

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,26 +1312,6 @@ version = "1.0.15"
13121312
source = "registry+https://github.com/rust-lang/crates.io-index"
13131313
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
13141314

1315-
[[package]]
1316-
name = "jemalloc-sys"
1317-
version = "0.5.4+5.3.0-patched"
1318-
source = "registry+https://github.com/rust-lang/crates.io-index"
1319-
checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2"
1320-
dependencies = [
1321-
"cc",
1322-
"libc",
1323-
]
1324-
1325-
[[package]]
1326-
name = "jemallocator"
1327-
version = "0.5.4"
1328-
source = "registry+https://github.com/rust-lang/crates.io-index"
1329-
checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc"
1330-
dependencies = [
1331-
"jemalloc-sys",
1332-
"libc",
1333-
]
1334-
13351315
[[package]]
13361316
name = "jiff"
13371317
version = "0.2.15"
@@ -1450,7 +1430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
14501430
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
14511431
dependencies = [
14521432
"cfg-if",
1453-
"windows-targets 0.48.5",
1433+
"windows-targets 0.52.6",
14541434
]
14551435

14561436
[[package]]
@@ -2862,13 +2842,13 @@ name = "linkerd2-proxy"
28622842
version = "0.1.0"
28632843
dependencies = [
28642844
"futures",
2865-
"jemallocator",
28662845
"kubert-prometheus-tokio",
28672846
"linkerd-app",
28682847
"linkerd-meshtls",
28692848
"linkerd-metrics",
28702849
"linkerd-signal",
28712850
"num_cpus",
2851+
"tikv-jemallocator",
28722852
"tokio",
28732853
"tracing",
28742854
]
@@ -4099,6 +4079,26 @@ dependencies = [
40994079
"cfg-if",
41004080
]
41014081

4082+
[[package]]
4083+
name = "tikv-jemalloc-sys"
4084+
version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
4085+
source = "registry+https://github.com/rust-lang/crates.io-index"
4086+
checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d"
4087+
dependencies = [
4088+
"cc",
4089+
"libc",
4090+
]
4091+
4092+
[[package]]
4093+
name = "tikv-jemallocator"
4094+
version = "0.6.0"
4095+
source = "registry+https://github.com/rust-lang/crates.io-index"
4096+
checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865"
4097+
dependencies = [
4098+
"libc",
4099+
"tikv-jemalloc-sys",
4100+
]
4101+
41024102
[[package]]
41034103
name = "time"
41044104
version = "0.3.41"

linkerd2-proxy/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ meshtls-rustls-aws-lc-fips = ["linkerd-meshtls/rustls-aws-lc-fips"]
1616
meshtls-rustls-ring = ["linkerd-meshtls/rustls-ring"]
1717
log-streaming = ["linkerd-app/log-streaming"]
1818
pprof = ["linkerd-app/pprof"]
19+
# From https://github.com/polarsignals/rust-jemalloc-pprof/blob/bcf1ad7f7ad3ec8e71098f4d5a9ce55905c7a602/README.md#usage
20+
jemalloc-profiling = [
21+
"tikv-jemallocator/profiling",
22+
"tikv-jemallocator/unprefixed_malloc_on_supported_platforms",
23+
]
1924

2025
[dependencies]
2126
futures = { version = "0.3", default-features = false }
@@ -31,7 +36,7 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "net"] }
3136
tracing = { workspace = true }
3237

3338
[target.x86_64-unknown-linux-gnu.dependencies]
34-
jemallocator = { version = "0.5" }
39+
tikv-jemallocator = "0.6"
3540

3641
[lints.rust]
3742
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }

linkerd2-proxy/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use tracing::{debug, info, warn};
2323

2424
#[cfg(all(target_os = "linux", target_arch = "x86_64", target_env = "gnu"))]
2525
#[global_allocator]
26-
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
26+
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
2727

2828
mod rt;
2929

0 commit comments

Comments
 (0)