Switch to jemalloc to reduce memory usage

This commit is contained in:
Klemens Schölhorn 2023-03-20 00:13:34 +01:00
parent 9b6a12f3da
commit b2207e4f48
3 changed files with 25 additions and 0 deletions

21
Cargo.lock generated
View File

@ -864,6 +864,7 @@ dependencies = [
"chrono", "chrono",
"hex", "hex",
"image", "image",
"jemallocator",
"kamadak-exif", "kamadak-exif",
"minijinja", "minijinja",
"serde", "serde",
@ -888,6 +889,26 @@ version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
[[package]]
name = "jemalloc-sys"
version = "0.5.3+5.3.0-patched"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9bd5d616ea7ed58b571b2e209a65759664d7fb021a0819d7a790afc67e47ca1"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "jemallocator"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16c2514137880c52b0b4822b563fadd38257c1f380858addb74a400889696ea6"
dependencies = [
"jemalloc-sys",
"libc",
]
[[package]] [[package]]
name = "jobserver" name = "jobserver"
version = "0.1.26" version = "0.1.26"

View File

@ -12,6 +12,7 @@ chacha20poly1305 = { version = "0.10.1", features = ["std"] }
chrono = "0.4.24" chrono = "0.4.24"
hex = { version = "0.4.3", features = ["serde"] } hex = { version = "0.4.3", features = ["serde"] }
image = { version = "0.24.5", default-features = false, features = ["jpeg", "webp-encoder"] } image = { version = "0.24.5", default-features = false, features = ["jpeg", "webp-encoder"] }
jemallocator = "0.5.0"
kamadak-exif = "0.5.5" kamadak-exif = "0.5.5"
minijinja = "0.30.4" minijinja = "0.30.4"
serde = { version = "1.0.152", features = ["derive"] } serde = { version = "1.0.152", features = ["derive"] }

View File

@ -17,6 +17,9 @@ use tracing_subscriber::{EnvFilter, layer::SubscriberExt, util::SubscriberInitEx
mod error; mod error;
#[global_allocator]
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
// TODO // TODO
// * Polish the css // * Polish the css
// * Add configuration file // * Add configuration file