Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use at most 8 threads for the xz stream
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
- Loading branch information