diff --git a/Cargo.lock b/Cargo.lock index 4e93f35..1d1e993 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -708,6 +708,7 @@ dependencies = [ "serde", "tempfile", "thiserror", + "tikv-jemallocator", "tokio", "tokio-stream", "tokio-util", @@ -882,6 +883,26 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8aa5b2ab86a2cefa406d889139c162cbb230092f7d1d7cbc1716405d852a3b" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0359b4327f954e0567e69fb191cf1436617748813819c94b8cd4a431422d053a" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + [[package]] name = "time" version = "0.3.45" diff --git a/Cargo.toml b/Cargo.toml index ee7b880..30ab931 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ description = "PXE boot server for multiple OSes with multiple configurations" license = "MIT" [dependencies] +tikv-jemallocator = "0.6" axum = "0.8" tokio = { version = "1", features = ["full", "signal"] } tokio-util = { version = "0.7", features = ["io"] } diff --git a/src/main.rs b/src/main.rs index f516f86..799b267 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,11 @@ //! //! HTTP server for PXE booting multiple OSes with multiple configurations. +use tikv_jemallocator::Jemalloc; + +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc; + mod config; mod error; mod routes;