Skip to content

Commit

Permalink
limit memory usage to 128 MiB
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Jan 3, 2024
1 parent 3987557 commit c39b2eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
22 changes: 20 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ hashbrown = { version = "0.14.0", features = [
criterion = { version = "0.5", features = ["async_futures"] }
tonic = { package = "madsim-tonic", version = "0.4.1" }
tonic-build = { package = "madsim-tonic-build", version = "0.4.2" }
otlp-embedded = "0.0.1"
otlp-embedded = { git = "https://github.com/risingwavelabs/otlp-embedded", rev = "58c1f003484449d7c6dd693b348bf19dd44889cb" }
prost = { version = "0.12" }
icelake = { git = "https://github.com/icelake-io/icelake", rev = "3f7b53ba5b563524212c25810345d1314678e7fc", features = [
"prometheus",
Expand Down
5 changes: 4 additions & 1 deletion src/meta/node/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,10 @@ pub async fn start_service_as_election_leader(
MetadataManager::V2(_) => None,
};

let trace_state = otlp_embedded::State::new(opts.cached_traces_num);
let trace_state = otlp_embedded::State::new(otlp_embedded::Config {
max_length: opts.cached_traces_num,
max_memory_usage: 1 << 27, // hard-code to limit memory usage to 128 MiB
});
let trace_srv = otlp_embedded::TraceServiceImpl::new(trace_state.clone());

#[cfg(not(madsim))]
Expand Down

0 comments on commit c39b2eb

Please sign in to comment.