-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Comments
madonuko
added
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
labels
Jul 4, 2024
madonuko
changed the title
Memory leak during doc-tests
Memory leak/spike during doc-tests
Jul 4, 2024
This is not a memory "leak". Under the current architecture, each doctest compiles to a separate binary on-the-fly, so there are N linking happening when compile N doctests. See some other issues:
We've already come up with some other ideas to resolve this. See: Close in favor of those issues. Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: