diff --git a/Cargo.lock b/Cargo.lock index e4a7e2bd7..fe9bc5181 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2351,8 +2351,6 @@ dependencies = [ "spool", "thiserror", "throttle", - "tikv-jemalloc-sys", - "tikv-jemallocator", "timeq", "tokio", "tokio-rustls 0.23.4", diff --git a/crates/kumo-server-memory/src/lib.rs b/crates/kumo-server-memory/src/lib.rs index 1ee42dd9f..42e5f6f58 100644 --- a/crates/kumo-server-memory/src/lib.rs +++ b/crates/kumo-server-memory/src/lib.rs @@ -11,8 +11,12 @@ use nix::unistd::{sysconf, SysconfVar}; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::Mutex; use std::time::Duration; +use tikv_jemallocator::Jemalloc; use tokio::sync::watch::Receiver; +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc; + lazy_static::lazy_static! { static ref OVER_LIMIT_COUNT: metrics::Counter = { metrics::describe_counter!( diff --git a/crates/kumod/Cargo.toml b/crates/kumod/Cargo.toml index b69ad9bf8..50d62b56d 100644 --- a/crates/kumod/Cargo.toml +++ b/crates/kumod/Cargo.toml @@ -31,8 +31,6 @@ gcd = "2.3" gethostname = "0.4" humansize = "2.1" # for printing json_comments = "0.2" -tikv-jemallocator = "0.5" -tikv-jemalloc-sys = {version="0.5", features=["profiling", "unprefixed_malloc_on_supported_platforms"]} kumo-api-types = {path="../kumo-api-types"} kumo-log-types = {path="../kumo-log-types"} kumo-server-common = {path="../kumo-server-common"} diff --git a/crates/kumod/src/main.rs b/crates/kumod/src/main.rs index fea6f576c..057dd9fe8 100644 --- a/crates/kumod/src/main.rs +++ b/crates/kumod/src/main.rs @@ -9,7 +9,6 @@ use nix::sys::signal::{kill, SIGQUIT}; use nix::unistd::{Pid, Uid, User}; use once_cell::sync::OnceCell; use std::path::PathBuf; -use tikv_jemallocator::Jemalloc; use tracing_subscriber::fmt::writer::BoxMakeWriter; use tracing_subscriber::prelude::*; use tracing_subscriber::{fmt, EnvFilter, Layer}; @@ -33,9 +32,6 @@ static TRACING_FILTER_RELOAD_HANDLE: OnceCell< Box anyhow::Result<()> + Send + Sync>, > = OnceCell::new(); -#[global_allocator] -static GLOBAL: Jemalloc = Jemalloc; - mod delivery_metrics; mod egress_path; mod egress_source;