Skip to content

resource_set for linking actions is too conservative #628

Open

Description

@JSGette

I came across usage of resource_set for linking actions and the formula that is used to compute how much RAM we should allocate per linking action seems to be too conservative:

return {"memory": max(50, -100 + 0.1 * inputs), "cpu": 1}

So, if one has 1000 inputs that leaves one with 50 Mb of RAM allocated for a single linking action which makes bazel very eager to schedule as many linking actions as it can simultaneously that sometimes leads to crashes due to OOM Killer, especially in containerized environments. I think, this formula should either be set to higher values or, ideally, we should expose resource allocation for both compilation and linking actions (e.g. size attribute for each cc_* rule)

Activity

  1. JSGette commented on Mar 16, 2026

    @JSGette
    Author

    Filed a PR: #636

  2. JSGette commented on Apr 13, 2026

    @JSGette
    Author

    Closed #636 in favor of a better future implementation that will just expose resource sets for all rules where it makes sense

  3. added
    P3
    on May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions