XZ - 메모리를 할당할 수 없습니다.

XZ - 메모리를 할당할 수 없습니다.

이 명령을 실행하면:

XZ_OPT=-9 tar --xz -cvf files/compressed/xz/archive.tar.xz -C files/original/ .

다음 메시지를 받았습니다:

xz: (stdin): Cannot allocate memory
tar: files/compressed/lzma//archive.lzma: Wrote only 4096 of 10240 bytes
tar: Error is not recoverable: exiting now

어떤 종류의 기억인가요? 아니면 어떻게 작동하도록 설정할 수 있습니까?

편집: (추가 정보)

압축하고 싶은 파일의 총 크기: 18.92M

Gzip Bzip2 ZIP - 잘 작동함

xz --info-memory:

Total amount of physical memory (RAM):  595 MiB (623116288 B)
Memory usage limit for compression:     Disabled
Memory usage limit for decompression:   Disabled

ulimit -a:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 2312
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 2312
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

답변1

에서는 압축에 674MiB의 메모리가 필요하다는 것을 man xz알 수 있습니다 (32MiB보다 큰 파일을 압축하는 경우에만 유용합니다). -9작업에 충분한 가상 메모리를 제공하기 위해 이 정도의 스왑을 추가해 보십시오(현재 메모리를 모두 다른 목적으로 사용한다고 가정).

답변2

나는 이것이 오래된 스레드라는 것을 알고 있지만 xz-9의 경우 메모리 제한은 13Mib이므로 사용하도록 설정한 경우 --memory=135000000사용 가능한 메모리가 그 만큼이면 실행되어야 합니다.

관련 정보