Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] xz memory hungry?
Date: Wed, 22 Aug 2012 19:08:34
Message-Id: CA+czFiAukdRt+S5VoXbX-pep38aCZiSDNTS5XO+ZDV9YG4MzdQ@mail.gmail.com
In Reply to: [gentoo-user] xz memory hungry? by Jorge Almeida
1 On Wed, Aug 22, 2012 at 2:52 PM, Jorge Almeida <jjalmeida@×××××.com> wrote:
2 > # tar -xJvf /usr/portage/distfiles/m4-1.4.16.tar.xz
3 > xz: (stdin): Cannot allocate memory
4 > tar: Child returned status 1
5 > tar: Error is not recoverable: exiting now
6 >
7 > The box has 2G ram + 1G swap. I'm installing Gentoo from an existing distro.
8 > Emerging fails on m4. tar xJvf fails both from within the chroot and from the
9 > host system. top shows that nothing is using any amount of memory worth
10 > mentioning. Extracting libtool-2.4.tar.xz works. I can extract
11 > m4-1.4.16.tar.xz in a computer with 4G ram. This is ridiculous. Not gentoo
12 > related, except that I have no choice, as m4 is pulled by other packages.
13 > What to do?
14 >
15 > app-arch/xz-utils-5.0.3 in chroot
16 > xz 5.0.4 in host system (Archlinux)
17
18 How much do you have free? From xz's manpage:
19
20 Memory usage
21 The memory usage of xz varies from a few hundred kilobytes
22 to several gigabytes
23 depending on the compression settings. The settings used
24 when compressing a file
25 determine the memory requirements of the decompressor.
26 Typically the decompressor
27 needs 5 % to 20 % of the amount of memory that the
28 compressor needed when creating
29 the file. For example, decompressing a file created with xz
30 -9 currently requires
31 65 MiB of memory. Still, it is possible to have .xz files that
32 require several giga‐
33 bytes of memory to decompress.
34
35
36 Three things come to mind:
37
38 1) You may not have enough memory free
39 2) There may be a bug (either compile/link-induced or code-induced) in
40 the copy of xz you're using
41 3) Upstream used some insane settings, causing a massive increase in
42 the amount of RAM required to decompress that stream.
43
44
45 You could download the .tar.xz file, decompress it on a different box,
46 and then recompress it with lighter settings.
47
48 unxz filename.tar.xz
49 xz -1 filename.tar
50
51 --
52 :wq

Replies

Subject Author
Re: [gentoo-user] xz memory hungry? Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] xz memory hungry? Jorge Almeida <jjalmeida@×××××.com>