rustc: Uses 75G of RAM and takes 1h30 on attached
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
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.rsto see at which step the compiler is stuck.kennytm at 2017-06-11 19:40:43
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.
Jonas Schievink at 2017-06-11 20:41:14
Triage: Still uses way too much RAM, still inside wf checking
Jonas Schievink at 2020-01-31 23:50:06
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...
Mark Rousskov at 2024-01-15 23:04:15
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?
tivrfoa at 2025-02-05 11:42:53
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.
Dave Gilbert at 2025-02-05 13:27:02
Ah there we go, it doesn't like a .rs file, so this is .rs.txt play-75G.rs.txt
Dave Gilbert at 2025-02-05 14:33:12