-
Notifications
You must be signed in to change notification settings - Fork 68
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
Use at most 8 threads for the xz stream #98
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
At preset 6, xz2 uses about 173MB of memory per thread. This adds up quickly -- e.g. over 8GB of memory on a 48-CPU machine. If you happen to try this in a 32-bit build, you'll get `LZMA_MEM_ERROR`. We can limit this to a heuristic maximum number of threads to avoid using so much memory, like xz's [`04_compress_easy_mt` example]. // The number 8 is arbitrarily chosen and may be too low or // high depending on the compression preset and the computer // being used. [`04_compress_easy_mt` example]: https://github.com/xz-mirror/xz/blob/de1f47b2b40e960b7bc3acba754f66dd19705921/doc/examples/04_compress_easy_mt.c#L71
(rust_highfive has picked a reviewer for you, use r? to override) |
This is not hypothetical -- I hit this error in a Fedora i686 build. The build machine had 2 socket Xeon E5-2670v3 (48 CPUs) with 128GB memory, but of course a 32-bit build has more limited address space. It ended with:
|
Oh wow, now that's gnarly! |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Aug 29, 2019
…Simulacrum Update rust-installer to limit memory use See rust-lang/rust-installer#98 -- on a many-core machine, the xz memory for so many threads is more than a 32-bit process can handle. The xz stream is now limited to 8 threads. r? @alexcrichton
Centril
added a commit
to Centril/rust
that referenced
this pull request
Aug 29, 2019
…Simulacrum Update rust-installer to limit memory use See rust-lang/rust-installer#98 -- on a many-core machine, the xz memory for so many threads is more than a 32-bit process can handle. The xz stream is now limited to 8 threads. r? @alexcrichton
Centril
added a commit
to Centril/rust
that referenced
this pull request
Aug 29, 2019
…Simulacrum Update rust-installer to limit memory use See rust-lang/rust-installer#98 -- on a many-core machine, the xz memory for so many threads is more than a 32-bit process can handle. The xz stream is now limited to 8 threads. r? @alexcrichton
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At preset 6, xz2 uses about 173MB of memory per thread. This adds up
quickly -- e.g. over 8GB of memory on a 48-CPU machine. If you happen to
try this in a 32-bit build, you'll get
LZMA_MEM_ERROR
.We can limit this to a heuristic maximum number of threads to avoid
using so much memory, like xz's
04_compress_easy_mt
example.