Skip to content

Commit

Permalink
Merge pull request fedimint#6357 from dpc/24-11-14-jemalloc-master
Browse files Browse the repository at this point in the history
chore: switch to using jemalloc on all major binaries.
  • Loading branch information
elsirion authored Nov 17, 2024
2 parents e493ea4 + 63db50b commit f39cee6
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ tbs = { package = "fedimint-tbs", path = "./crypto/tbs", version = "=0.6.0-alpha
thiserror = "1.0.68"
threshold_crypto = { version = "0.2.1", package = "fedimint-threshold-crypto" }
tokio = "1.41.1"
jemallocator = "0.5"
tokio-rustls = "0.24.1"
tokio-stream = "0.1.16"
tonic_lnd = { version = "0.2.0", package = "fedimint-tonic-lnd", features = [
Expand Down
3 changes: 3 additions & 0 deletions fedimint-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ tracing = { workspace = true }

[build-dependencies]
fedimint-build = { workspace = true }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
jemallocator = { workspace = true }
7 changes: 7 additions & 0 deletions fedimint-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use fedimint_cli::FedimintCli;
use fedimint_core::fedimint_build_code_version_env;
#[cfg(not(target_env = "msvc"))]
use jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[global_allocator]
// rocksdb suffers from memory fragmentation when using standard allocator
static GLOBAL: Jemalloc = Jemalloc;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand Down
3 changes: 3 additions & 0 deletions fedimintd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ tracing = { workspace = true }

[build-dependencies]
fedimint-build = { workspace = true }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
jemallocator = { workspace = true }
7 changes: 7 additions & 0 deletions fedimintd/src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use fedimint_core::fedimint_build_code_version_env;
use fedimintd::Fedimintd;
#[cfg(not(target_env = "msvc"))]
use jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[global_allocator]
// rocksdb suffers from memory fragmentation when using standard allocator
static GLOBAL: Jemalloc = Jemalloc;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand Down
3 changes: 3 additions & 0 deletions gateway/ln-gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ fedimint-unknown-server = { workspace = true }

[build-dependencies]
fedimint-build = { workspace = true }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
jemallocator = { workspace = true }
7 changes: 7 additions & 0 deletions gateway/ln-gateway/src/bin/gatewayd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ use fedimint_core::fedimint_build_code_version_env;
use fedimint_core::task::TaskGroup;
use fedimint_core::util::handle_version_hash_command;
use fedimint_logging::TracingSetup;
#[cfg(not(target_env = "msvc"))]
use jemallocator::Jemalloc;
use ln_gateway::Gateway;
use tracing::info;

#[cfg(not(target_env = "msvc"))]
#[global_allocator]
// rocksdb suffers from memory fragmentation when using standard allocator
static GLOBAL: Jemalloc = Jemalloc;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
handle_version_hash_command(fedimint_build_code_version_env!());
Expand Down

0 comments on commit f39cee6

Please sign in to comment.