Skip to content

Commit

Permalink
Use jemalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
ckamm committed Mar 22, 2024
1 parent 7e6a1a4 commit c687bf5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
21 changes: 21 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 @@ -60,6 +60,7 @@ prometheus = "0.13.3"
lazy_static = "1.4.0"
dotenv = "0.15.0"
async-channel = "1.8.0"
jemallocator = "0.5"

quinn = "0.10.2"
quinn-proto = "0.10.5"
Expand Down
1 change: 1 addition & 0 deletions lite-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ tokio = { version = "1.28.2", features = ["full", "fs"]}
tokio-util = "0.7"
tokio-postgres = { version = "0.7.8", features = ["with-chrono-0_4"] }
chrono = { workspace = true }
jemallocator = { workspace = true }

solana-lite-rpc-core = { workspace = true }
solana-lite-rpc-services = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions lite-rpc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ use tokio::sync::mpsc;
use tokio::sync::RwLock;
use tokio::time::{timeout, Instant};

// jemalloc seems to be better at keeping the memory footprint reasonable over
// longer periods of time
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

async fn get_latest_block(
mut block_stream: BlockStream,
commitment_config: CommitmentConfig,
Expand Down

0 comments on commit c687bf5

Please sign in to comment.