Skip to content

[Bug]: memory pressure in Bazel due to non-internable strings #2138

@alexeagle

Description

@alexeagle

What happened?

A Java Profiler run against Bazel's server reports lots of duplicate string data like

link attribute cannot be specified when link_packages are set

coming from

fail("link attribute cannot be specified when link_packages are set")

Fabian on Bazel slack:
https://bazelbuild.slack.com/archives/CDCMRLS23/p1742380269194209?thread_ts=1742216248.839529&cid=CDCMRLS23
explains this is because .bzl files generated into external repos are not de-duplicated by Bazel.

Any other information?

Starlark strings are interned per file. The same string repeated in multiple files (such as defs.bzl of each package) will be duplicated. See 2155 and 2157 for examples of reducing duplication in those files.

Related

Some fixes or sources of duplicate strings:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions