improvement: use jemalloc for lower memory usage

This commit is contained in:
Timo Kösters 2022-01-21 09:19:19 +01:00
parent 4ef995cf7d
commit f88523988e
No known key found for this signature in database
GPG key ID: 356E705610F626D5
3 changed files with 132 additions and 143 deletions

View file

@ -25,6 +25,13 @@ use tracing_subscriber::{prelude::*, EnvFilter};
pub use conduit::*; // Re-export everything from the library crate
pub use rocket::State;
#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;
#[cfg(not(target_env = "msvc"))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
fn setup_rocket(config: Figment, data: Arc<RwLock<Database>>) -> rocket::Rocket<rocket::Build> {
rocket::custom(config)
.manage(data)