Use jemalloc

Following https://github.com/romanz/electrs/issues/1114
This commit is contained in:
Roman Zeyde 2024-11-18 21:50:18 +02:00
parent 7de627e439
commit 8135daf656
3 changed files with 27 additions and 0 deletions

21
Cargo.lock generated
View file

@ -402,6 +402,7 @@ dependencies = [
"electrs-rocksdb",
"env_logger",
"hex_lit",
"jemallocator",
"log",
"parking_lot",
"prometheus",
@ -590,6 +591,26 @@ version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
[[package]]
name = "jemalloc-sys"
version = "0.5.4+5.3.0-patched"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "jemallocator"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc"
dependencies = [
"jemalloc-sys",
"libc",
]
[[package]]
name = "jobserver"
version = "0.1.26"

View file

@ -29,6 +29,7 @@ configure_me = "0.4"
crossbeam-channel = "0.5"
dirs-next = "2.0"
env_logger = "0.10"
jemallocator = "0.5"
log = "0.4"
parking_lot = "0.12"
prometheus = { version = "0.13", optional = true }

View file

@ -1,5 +1,10 @@
use anyhow::Result;
use jemallocator::Jemalloc;
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
fn main() -> Result<()> {
electrs::run()
}