Skip to content

Commit

Permalink
fix(capture-replay): try using jemalloc (#24778)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverb123 authored Sep 4, 2024
1 parent 43555bf commit 74420aa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions rust/capture/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ edition = "2021"
workspace = true

[dependencies]

[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator = "0.6"

anyhow = { workspace = true }
async-trait = { workspace = true }
axum = { workspace = true }
Expand Down
7 changes: 7 additions & 0 deletions rust/capture/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ use tracing_subscriber::{EnvFilter, Layer};
use capture::config::Config;
use capture::server::serve;

#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

async fn shutdown() {
let mut term = signal::unix::signal(signal::unix::SignalKind::terminate())
.expect("failed to register SIGTERM handler");
Expand Down

0 comments on commit 74420aa

Please sign in to comment.