[BUG] Exponential memory scaling and freezing compression process (LZMA2)
- Ngôn ngữ chính
- PHP
- Star
- 7.3k
- Fork
- 294
- Merge trung bình
- 14 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
### Configuration
- Keka version: 1.4.3 (5638) / Engine Tahoe 26.2 (7-Zip 24.09)
- macOS version: macOS 11.0+ (Apple Silicon M1/M2/M3)
### Describe the bug
There is a massive performance degradation and memory allocation issue when using the LZMA2 algorithm on Apple Silicon (ARM64). When compressing folders (especially those containing multimedia containers like .bik, .mp4), the process hangs, consumption of RAM spikes abnormally (up to 7-10 GB for small dictionaries), and the compression ratio is extremely poor (effectively zero in some cases).
The root cause is the outdated/buggy implementation of the 7-Zip (7zz) binary for ARM64 in versions 23.xx and 24.xx.
### To Reproduce
Steps to reproduce the behavior:
1. Take a folder with 3+ GB of data (e.g., game files with .bik videos).
2. Set compression to "Ultra/Slowest, more compression" (LZMA2, Dictionary 128MB+).
3. Start compression on an Apple Silicon Mac.
4. Observe the progress: it might take ±1 hour for a task that usually takes ±2-3 minutes, while RAM usage becomes unstable.
5. The resulting archive size is often much larger than expected (e.g., 3 GB vs 1 GB achieved by other archivers).
### Expected behavior
The compression should be fast and utilize the M1/M2/M3 performance cores correctly without memory "thrashing".
### Additional context
I have manually tested the latest 7-Zip 25.01 (7zz) source code, and the LZMA2 bug on ARM64 is finally fixed there. Performance has returned to normal (3 minutes vs 1 hour in previous versions).
Note for the developer:
When building the 7zz 25.01 binary for macOS using clang++, the build fails due to strict -Weverything and -Wfatal-errors flags in warn_clang_mac.mak (specifically the -Wswitch-default error).
To fix the build, you need to patch the warning flags. Example:
```sh
sed -i '' 's/-Weverything/-Weverything -Wno-switch-default/g' CPP/7zip/warn_clang_mac.mak
```
Updating the internal 7zz engine to 25.01 will solve all reported LZMA2 performance issues on Apple Silicon.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.