From owner-freebsd-ports@FreeBSD.ORG Fri Dec 3 21:08:06 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1D57106566C for ; Fri, 3 Dec 2010 21:08:06 +0000 (UTC) (envelope-from freebsd-ports@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 2961C8FC12 for ; Fri, 3 Dec 2010 21:08:05 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1POcrL-0005go-I7 for freebsd-ports@freebsd.org; Fri, 03 Dec 2010 22:08:03 +0100 Received: from 193.33.173.33 ([193.33.173.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Dec 2010 22:08:03 +0100 Received: from c.kworr by 193.33.173.33 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Dec 2010 22:08:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-ports@freebsd.org From: Volodymyr Kostyrko Date: Fri, 03 Dec 2010 23:07:51 +0200 Lines: 41 Message-ID: <4CF95C27.4030507@gmail.com> References: <4CF38D7F.6070206@gmx.de> <4CF3F16E.3020501@DataIX.net> <4CF439F1.6050703@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 193.33.173.33 User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; uk-UA; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 In-Reply-To: Cc: Matthias Andree , freebsd-ports@freebsd.org Subject: Re: packages compressed with xz X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 21:08:06 -0000 30.11.2010 04:40, Julien Laffaye wrote: > You can specify limits during compression, so the question is should we do that > so that hosts with N MB of RAM can decompress packages? Do we retain the > compression ratio over bzip2 if we limit compression memory to 512 MB so that > decompression would be possible with, say, 128 MB? > > According to xz(1), in its default mode (-6), xz uses ~100MiB for > compression and ~10MiB for decompression. > That seems to be acceptable. You possibly miss something about compression/decompression. The designated memory size is not directly affected only by compression mode. When decompressing you will need memory for: 1. Data history. 2. Dictionary. 3. Some indexes. And those ones are all empty at start. So say, if you are compressing something really huge trying to use 4G of memory you end using that much memory between 2G - 3G of source data. And we will need 512MB to decompress that hunk of data. Are the packages _that_ large? I think that in worst possible case we need to double the size of package for comfort decompression. If the lower point is 64Mb then 32Mb package compressed with any compression strategy would be decompressed without hitting a swap. We'll need someone to do actual testing but look at this one: # ls -la ImageMagick-6.6.5-10.tar.xz -rw-r--r-- 1 root wheel 6316324 21 ноя 23:52 ImageMagick-6.6.5-10.tar.xz # time xz -dt ImageMagick-6.6.5-10.tar.xz 0.860u 0.036s 0:01.02 87.2% 68+1492k 56+0io 1pf+0w -- Sphinx of black quartz judge my vow.