Skip to content

1.98 memory usage regression #161660

Description

@sveitser

Overall memory requirement for compiling our espresso-node crate roughly doubles from 10GB to 20GB from 1.97.1 to 1.98. The issue was discovered because our CI runners have 16GB RAM and fail to build on 1.98

Example: https://github.com/EspressoSystems/espresso-network/actions/runs/32478615863/job/96760043575

Exit code: 143

LLM assisted bisection yielded #156417 as the cause. I can provide more of the LLMs outputs if useful.

Code

I tried this code:

git clone https://github.com/EspressoSystems/espresso-network
cd espresso-network
RUSTC_BOOTSTRAP=espresso_network cargo rustc -p espresso-node --lib -- -Ztime-passes

I expected to see this happen: compiles with roughly the same memory requirement as 1.97.1

$ RUSTC_BOOTSTRAP=espresso_network cargo rustc -p espresso-node --lib -- -Ztime-passes
..
time:   0.001; rss: 1372MB -> 1372MB (   +0MB)	monomorphization_collector_root_collections
time:  57.142; rss: 1372MB -> 3067MB (+1695MB)	monomorphization_collector_graph_walk
time:   3.256; rss: 3061MB -> 3344MB ( +283MB)	partition_and_assert_distinct_symbols
time:  71.973; rss: 1358MB -> 3291MB (+1933MB)	generate_crate_metadata
time:   0.000; rss: 3291MB -> 3291MB (   +0MB)	find_cgu_reuse
time:  16.406; rss: 3291MB -> 3838MB ( +547MB)	codegen_to_LLVM_IR
time:  16.450; rss: 3291MB -> 3838MB ( +547MB)	codegen_crate
time:   0.000; rss: 3839MB -> 3839MB (   +0MB)	incr_comp_persist_dep_graph
time:  14.824; rss: 3666MB -> 3834MB ( +169MB)	LLVM_passes
..

Instead, this happened: Uses significantly more memory on 1.98

$ RUSTC_BOOTSTRAP=espresso_network cargo rustc -p espresso-node --lib -- -Ztime-passes
..
time:   0.001; rss: 1345MB -> 1345MB (   +0MB)	monomorphization_collector_root_collections
time:  65.445; rss: 1345MB -> 14974MB (+13629MB)	monomorphization_collector_graph_walk
time:   3.033; rss: 14987MB -> 15276MB ( +289MB)	partition_and_assert_distinct_symbols
time:  78.328; rss: 1350MB -> 15220MB (+13870MB)	generate_crate_metadata
time:   0.000; rss: 15220MB -> 15220MB (   +0MB)	find_cgu_reuse
time:  16.254; rss: 15220MB -> 17343MB (+2123MB)	codegen_to_LLVM_IR
time:  16.256; rss: 15220MB -> 17344MB (+2124MB)	codegen_crate
time:   0.000; rss: 17344MB -> 17344MB (   +0MB)	serialize_dep_graph
time:  18.253; rss: 15418MB -> 6046MB (-9372MB)	LLVM_passes
..

Version it worked on

rustc 1.97.1 (8bab26f4f 2026-07-14)
binary: rustc
commit-hash: 8bab26f4f68e0e26f0bb7960be334d5b520ea452
commit-date: 2026-07-14
host: x86_64-unknown-linux-gnu
release: 1.97.1
LLVM version: 22.1.6

Version with regression

rustc 1.98.0 (88d9e12ae 2026-08-18)
binary: rustc
commit-hash: 88d9e12ae178fab0fb5cc050a94da85685d449ea
commit-date: 2026-08-18
host: x86_64-unknown-linux-gnu
release: 1.98.0
LLVM version: 22.1.8

Backtrace

no crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.regression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions