bazelbuild / bazelbuild/bazel

Enable --shutdown_on_low_sys_mem by default to avoid system-wide memory pressure

Open
#7,600 7 comments 0 reactions 0 assignees View on GitHub
P2 team-Documentation team-Local-Exec type: documentation (cleanup) type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the problem / feature request:

Now that I started on some open source projects around bazel, that might be some rules or contributions to bazel itself, as well as us using it in our monorepo I am noticing I sometimes have two or even three bazel server's running at the same time and that is really straining my machine and sometimes getting it to freeze for a very long time. The problem seems to be mostly due to memory usage of the server. Even when it is sitting idle after >10min of no usage I can still see it using up over 2GB of memory plus more virtual memory.

### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Not sure if this is a bug or feature request, but either way, use a machine with 16GB of memory, have things open for a normal developer setup, browser with a few tabs, vs code/IDE, slack, a terminal with a few tabs and start running tests in two or three different repositories using bazel. It does not have to be in parallel.

### What operating system are you running Bazel on?

Elementary OS 5 (Ubuntu 18.04)

### What's the output of `bazel info release`?

release 0.23.0rc3

### Any other information, logs, or outputs that you want to share?

To be honest, I am not sure if there is anything that can be done directly, or if the best answer is just one has to rune `bazel shutdown` but I think it is also important to be aware of this issue, maybe there is also something that can be improved in bazel.

Only thing related I could find: https://github.com/bazelbuild/bazel/issues/7446

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing --shutdown_on_low_sys_mem behavior and the related issue #7446. Identify where Bazel sets this option's default and how its behavior is tested; done means the option is enabled by default and the relevant tests cover that default.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.