From c1055d173e7263ce7618ff4b297daa41b12a765d Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 12 Apr 2011 14:40:51 +1000 Subject: [PATCH 1/2] Clamp largest 32bit usable chunk to 2/3 of 1GB. --- main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 8b4fd8e..b76716b 100644 --- a/main.c +++ b/main.c @@ -776,10 +776,13 @@ int main(int argc, char *argv[]) /* Decrease usable ram size on 32 bits due to kernel / * userspace split. Cannot allocate larger than a 1 * gigabyte chunk due to 32 bit signed long being - * used in alloc */ + * used in alloc, and at most 3GB can be malloced, and + * 2/3 of that makes for a total of 2GB to be split + * into thirds. + */ control.usable_ram = MAX(control.ramsize - 900000000ll, 900000000ll); control.maxram = MIN(control.maxram, control.usable_ram); - control.maxram = MIN(control.maxram, one_g); + control.maxram = MIN(control.maxram, one_g * 2 / 3); } else control.usable_ram = control.maxram; round_to_page(&control.maxram); From f424af288b391bebd22ef5de9ac1192b30ef9e3b Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 12 Apr 2011 14:43:20 +1000 Subject: [PATCH 2/2] Add reminder to set CFLAGS to readme. --- README | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README b/README index 2892d6c..8f568f2 100644 --- a/README +++ b/README @@ -308,6 +308,10 @@ A. See http://www.7-zip.org and http://www.p7zip.org. Also, see the file ./lzma/C/lzmalib.h which explains the LZMA properties used and the LZMA memory requirements and computation. +Q. This version is much slower than the old version? +A. Make sure you have set CFLAGS and CXXFLAGS. An unoptimised build will be +almost 3 times slower. + LIMITATIONS Due to mmap limitations the maximum size a window can be set to is currently 2GB on 32bit unless the -U option is specified. Files generated on 64 bit