-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
1.12.0: High memory usage when linking in release mode with debug info #36926
Comments
Not a solution, but a useful tip might be to try the gold linker (not yet default in rustc), if availabe. Rustc flag is |
@rphmeier is this a regression for 1.11, or just a bug in general? |
Appears to be a regression from 1.11.0, we didn't experience any abnormally high memory usage until then. Looks like it mostly affects users of OSX. |
Ok, thanks for the info! Tagged as such. |
You might try 1.11 again with |
cc @michaelwoerister @rust-lang/compiler |
1.11 with
|
The other way around should also work: 1.12 with |
@rphmeier so I'm trying to build this on a fresh windows VM but encountering some weird errors like this (which seem quite unrelated to the problem you are seeing):
Any thoughts on what I have to do here? I did install Visual Studio, but perhaps the right directories are not in my path? |
@nikomatsakis I believe you need to use the "VS2015 x64 Native Tools Command Prompt" |
@nikomatsakis the latest master has |
@arkpar thanks (for both comments =) |
OK, so, my efforts to reproduce this have not, in fact, reproduced the memory usage. I do however see this:
which I guess is #36924 |
The memory issue has been reported for OSX and Linux specifically. Sorry for the confusion |
No need to apologize, I see that @rphmeier in fact wrote this specifically:
I'm just juggling too many things I guess. =( I'll try again on OS/X. Good to be able to reproduce #36924 regardless, I suppose. |
High memory usage (causing my Windows to page to death - when will Microsoft understand that the alternative to the OOM killer is the power switch) confirmed on Rust 1.14 on 64-bit MSVC. |
I was able to reproduce this on Linux with the 1.12 compiler, but I was unable to get Valgrind's massif tool to work with that compiler because of jemalloc. I recompiled 3191fba (the current master as of a few hours ago) with The first peak in the profile has 80% of the memory with one stack trace, which to me looks like LLVM. This may either be fixed upstream, or it's something we should probably report upstream. |
I suppose this could also be how MIR inevitably changed our debuginfo output from old trans, so something there may have accidentally triggered something pathological. |
This might be relevant: https://llvm.org/bugs/show_bug.cgi?id=26055 |
From the commit message of the patch:
|
@michaelwoerister Great find! I'm not too knowledgeable about the Rust release conventions, but if this LLVM patch were to be backported, would it find its way into the beta branch or only nightly? |
@rphmeier If the patch is small enough, maybe? Do we have precedent for that, updating LLVM in beta, @brson @alexcrichton ? |
I'm not sure if we have precedent, but that patch seems small enough that I'd be fine backporting. I think we'd have to prep two separate LLVM branches (to backport to both nightly and beta), but that seems fine to me. |
A little update: I was able to reproduce the memory spike in LLVM codegen passes on Linux (stable + nightly) and OS X (stable + nightly). |
Alright, cherry-picking the following two commits solves the problem on nightly: How should we proceed? Apply the patches on all 3 channels? It is kind of a corner case that is only hit when turning on optimizations and debuginfo and probably having a big function with lots of inlining that triggers the pathological case. |
Thanks for the investigation @michaelwoerister! My preferred course of action would be:
Then determine if we'd like to land on stable (doing the same backporting). @brson thoughts? |
Removed I-nominated tag since we've talked about this in the compiler meeting. |
I've opened a PR with the fixes against the LLVM version that nightly uses: rust-lang/llvm#53 |
…crichton llvm: Update LLVM to include fix for pathologic case in its LiveDebugValues pass. See #36926. r? @alexcrichton
This should be fixed in nightly builds, right? (We're still waiting on a backport, afaik) |
Yes, the latest nightly should contain the fix. |
Confirmed in |
Thanks @arkpar! |
Reports of OOM, using 18GB of memory while building https://github.com/ethcore/parity in release mode with debuginfo.
Known to affect OSX and Linux, possibly Windows but unconfirmed.
The text was updated successfully, but these errors were encountered: