diff --git a/Cargo.lock b/Cargo.lock index c2a5575a8275d0..c5c7f72509b291 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -152,6 +152,7 @@ dependencies = [ "histogram", "itertools", "log", + "mimalloc", "num_cpus", "rayon", "regex", @@ -209,6 +210,7 @@ dependencies = [ "libc", "libloading", "log", + "mimalloc", "num_cpus", "rand 0.8.5", "rayon", @@ -3170,6 +3172,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" +[[package]] +name = "libmimalloc-sys" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81eb4061c0582dedea1cbc7aff2240300dd6982e0239d1c99e65c1dbf4a30ba7" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "librocksdb-sys" version = "0.16.0+8.10.0" @@ -3382,6 +3394,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mimalloc" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f41a2280ded0da56c8cf898babb86e8f10651a34adcfff190ae9a1159c6908d" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "mime" version = "0.3.16" diff --git a/Cargo.toml b/Cargo.toml index a70915850676a6..b6bcd75f8a87a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -250,6 +250,7 @@ lz4 = "1.24.0" memmap2 = "0.5.10" memoffset = "0.9" merlin = "3" +mimalloc = "0.1.41" min-max-heap = "1.3.0" mockall = "0.11.4" modular-bitfield = "0.11.2" diff --git a/ledger-tool/Cargo.toml b/ledger-tool/Cargo.toml index 7d527c91842479..2ea9369991cee0 100644 --- a/ledger-tool/Cargo.toml +++ b/ledger-tool/Cargo.toml @@ -20,6 +20,7 @@ futures = { workspace = true } histogram = { workspace = true } itertools = { workspace = true } log = { workspace = true } +mimalloc = { workspace = true } num_cpus = { workspace = true } rayon = { workspace = true } regex = { workspace = true } diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 27fbf778a22e5c..1dcde0b7781771 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -537,11 +537,11 @@ fn assert_capitalization(bank: &Bank) { } #[cfg(not(target_env = "msvc"))] -use jemallocator::Jemalloc; +use mimalloc::MiMalloc; #[cfg(not(target_env = "msvc"))] #[global_allocator] -static GLOBAL: Jemalloc = Jemalloc; +static GLOBAL: MiMalloc = MiMalloc; #[allow(clippy::cognitive_complexity)] fn main() { diff --git a/validator/Cargo.toml b/validator/Cargo.toml index 6222435906a31d..6a3e12c85c6b7b 100644 --- a/validator/Cargo.toml +++ b/validator/Cargo.toml @@ -27,6 +27,7 @@ jsonrpc-ipc-server = { workspace = true } lazy_static = { workspace = true } libloading = { workspace = true } log = { workspace = true } +mimalloc = { workspace = true } num_cpus = { workspace = true } rand = { workspace = true } rayon = { workspace = true } diff --git a/validator/src/main.rs b/validator/src/main.rs index c349b9655ec11c..1159378aedaafb 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -1,6 +1,6 @@ #![allow(clippy::arithmetic_side_effects)] #[cfg(not(target_env = "msvc"))] -use jemallocator::Jemalloc; +use mimalloc::MiMalloc; use { agave_validator::{ admin_rpc_service, @@ -88,7 +88,7 @@ use { #[cfg(not(target_env = "msvc"))] #[global_allocator] -static GLOBAL: Jemalloc = Jemalloc; +static GLOBAL: MiMalloc = MiMalloc; #[derive(Debug, PartialEq, Eq)] enum Operation {