Skip to content

rustc: Uses 75G of RAM and takes 1h30 on attached #42596

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

Open
penguin42 opened this issue Jun 11, 2017 · 7 comments
Open

rustc: Uses 75G of RAM and takes 1h30 on attached #42596

penguin42 opened this issue Jun 11, 2017 · 7 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@penguin42
Copy link

The code at http://www.treblig.org/daveG/play-75G.rs (attached) causes rustc to take 75G of RAM and 1.5hours to compile (before it spits a reasonable error)

It is an experiment with type unification and does contain a screwup; when I fixed the screwup it returned to taking about 2mins and about 250MB even with all my type unification fun; I've not changed the recursion limits.

75G is probably bad; I can't necessarily call it a bug but it does smell suspicious; I'm wondering if it's associated with the code that reports the 'trait bound .... is not satisfied' and providing the explanation of it.
play-75G.txt

rustc 1.17.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.17.0
LLVM version: 3.9

@kennytm
Copy link
Member

kennytm commented Jun 11, 2017

Could you run with newer rustc (1.18-stable, 1.19-beta or nightly) and see if it still takes more than 2 minutes?

Also, you could use rustc -Ztime-passes play-75G.rs to see at which step the compiler is stuck.

@jonas-schievink
Copy link
Contributor

Happens on current nightly (but I aborted after a few minutes at >2GiB), it gets stuck after variance testing, so it's inside "wf checking" when the problem occurs.

@sanxiyn sanxiyn added the I-compiletime Issue: Problems and improvements with respect to compile times. label Jun 12, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 27, 2017
@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 15, 2017
@jonas-schievink jonas-schievink added the I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. label Jan 31, 2020
@jonas-schievink
Copy link
Contributor

Triage: Still uses way too much RAM, still inside wf checking

@Mark-Simulacrum
Copy link
Member

This now hits the first error in ~2.5 minutes for me using somewhere around ~20-30 GB of RAM (didn't watch top too closely) at peak. It does continue to run afterwards, using increasingly more memory, but it seems like the first error is the most important part...

@tivrfoa
Copy link

tivrfoa commented Feb 5, 2025

The code at http://www.treblig.org/daveG/play-75G.rs (attached) causes rustc to take 75G of RAM and 1.5hours to compile (before it spits a reasonable error)

It is an experiment with type unification and does contain a screwup; when I fixed the screwup it returned to taking about 2mins and about 250MB even with all my type unification fun; I've not changed the recursion limits.

75G is probably bad; I can't necessarily call it a bug but it does smell suspicious; I'm wondering if it's associated with the code that reports the 'trait bound .... is not satisfied' and providing the explanation of it. play-75G.txt

rustc 1.17.0 binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-unknown-linux-gnu release: 1.17.0 LLVM version: 3.9

It seems the link is not available anymore: http://www.treblig.org/daveG/play-75G.rs

@penguin42 , could you share the code here, please?

@penguin42
Copy link
Author

I've put the file back at that link again; and checked it's still taking over an hour and somewhere over 20G and still going.

@penguin42
Copy link
Author

Ah there we go, it doesn't like a .rs file, so this is .rs.txt
play-75G.rs.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants