Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up1.12.0: High memory usage when linking in release mode with debug info #36926
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Not a solution, but a useful tip might be to try the gold linker (not yet default in rustc), if availabe. Rustc flag is |
This comment has been minimized.
This comment has been minimized.
|
@rphmeier is this a regression for 1.11, or just a bug in general? |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
Ok, thanks for the info! Tagged as such. |
This comment has been minimized.
This comment has been minimized.
|
You might try 1.11 again with |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
tomusdrw
commented
Oct 4, 2016
|
1.11 with
|
This comment has been minimized.
This comment has been minimized.
|
The other way around should also work: 1.12 with |
This comment has been minimized.
This comment has been minimized.
|
@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? |
This comment has been minimized.
This comment has been minimized.
arkpar
commented
Oct 4, 2016
|
@nikomatsakis I believe you need to use the "VS2015 x64 Native Tools Command Prompt" |
This comment has been minimized.
This comment has been minimized.
arkpar
commented
Oct 4, 2016
•
|
@nikomatsakis the latest master has |
This comment has been minimized.
This comment has been minimized.
|
@arkpar thanks (for both comments =) |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
arkpar
commented
Oct 4, 2016
|
The memory issue has been reported for OSX and Linux specifically. Sorry for the confusion |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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 comment has been minimized.
This comment has been minimized.
|
This might be relevant: https://llvm.org/bugs/show_bug.cgi?id=26055 |
This comment has been minimized.
This comment has been minimized.
|
From the commit message of the patch:
|
brson
added
the
P-high
label
Oct 6, 2016
brson
assigned
michaelwoerister
Oct 6, 2016
This comment has been minimized.
This comment has been minimized.
|
@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? |
This comment has been minimized.
This comment has been minimized.
|
@rphmeier If the patch is small enough, maybe? Do we have precedent for that, updating LLVM in beta, @brson @alexcrichton ? |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
A little update: I was able to reproduce the memory spike in LLVM codegen passes on Linux (stable + nightly) and OS X (stable + nightly). |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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? |
michaelwoerister
removed
the
I-nominated
label
Oct 7, 2016
This comment has been minimized.
This comment has been minimized.
|
Removed I-nominated tag since we've talked about this in the compiler meeting. |
michaelwoerister
referenced this issue
Oct 7, 2016
Merged
Cherry-pick fixes for LiveDebugValues pass. #53
This comment has been minimized.
This comment has been minimized.
|
I've opened a PR with the fixes against the LLVM version that nightly uses: rust-lang/llvm#53 |
michaelwoerister
referenced this issue
Oct 7, 2016
Merged
llvm: Update LLVM to include fix for pathologic case in its LiveDebugValues pass. #37030
bors
added a commit
that referenced
this issue
Oct 7, 2016
bors
added a commit
that referenced
this issue
Oct 10, 2016
This comment has been minimized.
This comment has been minimized.
|
This should be fixed in nightly builds, right? (We're still waiting on a backport, afaik) |
This comment has been minimized.
This comment has been minimized.
|
Yes, the latest nightly should contain the fix. |
This comment has been minimized.
This comment has been minimized.
arkpar
commented
Oct 14, 2016
|
Confirmed in |
This comment has been minimized.
This comment has been minimized.
|
Thanks @arkpar! |
rphmeier commentedOct 3, 2016
•
edited
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.