This repository was archived by the owner on Aug 25, 2025. It is now read-only.
Commit 3d7273c
committed
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#L711 parent 85958b0 commit 3d7273c
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | | - | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
0 commit comments