Skip to content

Commit

Permalink
Only perform malloc tuning for beacon node (#2397)
Browse files Browse the repository at this point in the history
## Issue Addressed

NA

## Proposed Changes

Only run `configure_memory_alllocator` for the BN process.

I noticed that VC memory usage increases significantly with the new malloc tuning parameters. This was also raised by a user on [r/ethstaker](https://www.reddit.com/r/ethstaker/comments/nr8998/lighthouse_prerelease_v140rc0/h0fnt9l?utm_source=share&utm_medium=web2x&context=3).

There wasn't any issue with memory usage by the VC before we implemented #2296, so I think we were a bit overzealous when we allowed these changes to affect it. This PR allows things that weren't broken to remain unfixed.

## Additional Info

NA
  • Loading branch information
paulhauner committed Jun 7, 2021
1 parent 93100f2 commit 4a6f2fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lighthouse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ fn main() {

// Configure the allocator early in the process, before it has the chance to use the default values for
// anything important.
if !matches.is_present(DISABLE_MALLOC_TUNING_FLAG) {
//
// Only apply this optimization for the beacon node. It's the only process with a substantial
// memory footprint.
let is_beacon_node = matches.subcommand_name() == Some("beacon_node");
if is_beacon_node && !matches.is_present(DISABLE_MALLOC_TUNING_FLAG) {
if let Err(e) = configure_memory_allocator() {
eprintln!(
"Unable to configure the memory allocator: {} \n\
Expand Down

0 comments on commit 4a6f2fa

Please sign in to comment.