Memory leak/spike during doc-tests #14190
Labels
A-doctests
Area: rustdoc --test
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
Both
cargo test
andcargo test --doc
use around(1 + n)
GB of memory during doc-test linking, wheren
is the number of doc-tests. This behaviour can be seen here:2024-07-04.19-59-38.copy.mp4
The code in question is https://github.com/rpm-rs/rpmspec-rs (master branch or commit
1e57d1d
)Steps
Try removing one of the doc-tests. On my machine, for every doc-test I remove, the memory usage drops by 1 GB.
Possible Solution(s)
No response
Notes
Things I have already tried
cargo clean
, problem persists#[test]
s, memory issue disappears entirelyExtra notes
Notice the memory usage comes from
ld
(see the video above). However, this only happens with doc-tests; this never happens undercargo check
,cargo build
and normal tests (i.e.cargo test
excluding doc-tests).Version
The text was updated successfully, but these errors were encountered: