diff --git a/Cargo.lock b/Cargo.lock index 31f43150b22be1..b28fdd7794421c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6491,6 +6491,7 @@ dependencies = [ "solana-vote-program", "solana_rbpf", "thiserror", + "tikv-jemallocator", "tokio", ] diff --git a/ledger-tool/Cargo.toml b/ledger-tool/Cargo.toml index 1f0fb466419631..ddc1ca9b564e94 100644 --- a/ledger-tool/Cargo.toml +++ b/ledger-tool/Cargo.toml @@ -52,6 +52,9 @@ solana_rbpf = { workspace = true, features = ["debugger"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } +[target.'cfg(not(target_env = "msvc"))'.dependencies] +jemallocator = { workspace = true } + [dev-dependencies] assert_cmd = { workspace = true } bytecount = { workspace = true } diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index d0cf79e76edada..aeed93fd2ff46e 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -1062,6 +1062,13 @@ fn get_access_type(process_options: &ProcessOptions) -> AccessType { } } +#[cfg(not(target_env = "msvc"))] +use jemallocator::Jemalloc; + +#[cfg(not(target_env = "msvc"))] +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc; + #[allow(clippy::cognitive_complexity)] fn main() { // Ignore SIGUSR1 to prevent long-running calls being killed by logrotate