From aadc8391153b7b939462752dfa3f8dec49b2eba1 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Mon, 21 Nov 2011 16:53:17 +0200 Subject: [PATCH] smaller default dynamic-space size on GENCGC 512Mb for 32-bit platforms, 1Gb for 64-bit ones. (OpenBSD/x86-64 is the exception using 444Mb to fit under default ulimits.) --- INSTALL | 8 +++++--- NEWS | 8 ++++++++ src/compiler/generic/parms.lisp | 10 +++++++--- src/compiler/ppc/parms.lisp | 8 ++++---- src/compiler/x86-64/parms.lisp | 2 +- src/compiler/x86/parms.lisp | 14 +++++++------- 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/INSTALL b/INSTALL index b1413ab..3137709 100644 --- a/INSTALL +++ b/INSTALL @@ -129,11 +129,13 @@ INSTALLING SBCL To configure SBCL with a non-standard default dynamic-space size, use the --dynamic-space-size option: - $ sh make.sh --dynamic-space-size=1Gb - $ sh make.sh --dynamic-space-size=500Mb + $ sh make.sh --dynamic-space-size=4Gb + $ sh make.sh --dynamic-space-size=800Mb If mega- or gigabytes are not specified, the number is taken to be - in megabytes. The standard default is platform specific. + in megabytes. The standard default is 512Mb for 32-bit systems, and + 1Gb for 64-bit systems (with the exception of OpenBSD where 444Mb + are used to fit under default ulimits.) If you don't already have an SBCL binary installed as "sbcl" on your system, you'll need to tell make.sh what Lisp to use as the diff --git a/NEWS b/NEWS index b9fcd77..5906f33 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,14 @@ changes relative to sbcl-1.0.53: * GC-related enhancements and bug fixes: ** --dynamic-space-size and --control-stack-size now understand Kb, Mb, and Gb suffixes. Default is megabytes as before. + ** Default dynamic space size on all GENCGC platforms is now 512Mb for + 32-bit systems, and 1Gb for 64-bit systems. (OpenBSD/x86-64 is the only + exception, defaulting to mere 444Mb to fit under default ulimits.) The + new defaults are in place to prevent hitting swap on low-end systems. + Use build-time option --dynamic-space-size to build an SBCL with + another default, or the runtime option to adjust the size at startup: a + good size is at most equal to the amount of physical memory the system + has. ** on GENCGC systems nursery and generation sizes now default to 5% of dynamic-space size. ** on 64-bit systems setting the nursery size above 4Gb now diff --git a/src/compiler/generic/parms.lisp b/src/compiler/generic/parms.lisp index bbd4eae..233f39a 100644 --- a/src/compiler/generic/parms.lisp +++ b/src/compiler/generic/parms.lisp @@ -12,7 +12,7 @@ (in-package "SB!VM") -(def!macro !configure-dynamic-space-end (default) +(def!macro !configure-dynamic-space-end (&optional default) (with-open-file (f "output/dynamic-space-size.txt") (let ((line (read-line f))) (multiple-value-bind (number end) @@ -26,8 +26,12 @@ (expt 2 30)) (t (error "Invalid --dynamic-space-size=~A" line))))) - `(+ dynamic-space-start ,(* number mult))) - default))))) + `(+ dynamic-space-start ,(* number mult)))) + (or default + `(+ dynamic-space-start + (ecase n-word-bits + (32 (expt 2 29)) + (64 (expt 2 30))))))))) (defparameter *c-callable-static-symbols* '(sub-gc diff --git a/src/compiler/ppc/parms.lisp b/src/compiler/ppc/parms.lisp index 363556b..a975b43 100644 --- a/src/compiler/ppc/parms.lisp +++ b/src/compiler/ppc/parms.lisp @@ -116,7 +116,7 @@ #!+gencgc (progn (def!constant dynamic-space-start #x4f000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x7efff000))) + (def!constant dynamic-space-end (!configure-dynamic-space-end))) #!-gencgc (progn (def!constant dynamic-0-space-start #x4f000000) @@ -129,7 +129,7 @@ #!+gencgc (progn (def!constant dynamic-space-start #x4f000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x7efff000))) + (def!constant dynamic-space-end (!configure-dynamic-space-end))) #!-gencgc (progn (def!constant dynamic-0-space-start #x4f000000) @@ -149,7 +149,7 @@ #!+gencgc (progn (def!constant dynamic-space-start #x4f000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x6afff000))) + (def!constant dynamic-space-end (!configure-dynamic-space-end))) #!-gencgc (progn (def!constant dynamic-0-space-start #x4f000000) @@ -162,7 +162,7 @@ #!+gencgc (progn (def!constant dynamic-space-start #x10000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x6ffff000))) + (def!constant dynamic-space-end (!configure-dynamic-space-end))) #!-gencgc (progn (def!constant dynamic-0-space-start #x10000000) diff --git a/src/compiler/x86-64/parms.lisp b/src/compiler/x86-64/parms.lisp index 89017d3..1dbc383 100644 --- a/src/compiler/x86-64/parms.lisp +++ b/src/compiler/x86-64/parms.lisp @@ -112,7 +112,7 @@ (def!constant dynamic-space-start #x1000000000) #!-openbsd - (def!constant dynamic-space-end (!configure-dynamic-space-end #x11ffff0000)) + (def!constant dynamic-space-end (!configure-dynamic-space-end)) #!+openbsd ;; This is lower on OpenBSD to allow SBCL to run under the default ;; 512M data size limit. diff --git a/src/compiler/x86/parms.lisp b/src/compiler/x86/parms.lisp index 9246094..89e56d6 100644 --- a/src/compiler/x86/parms.lisp +++ b/src/compiler/x86/parms.lisp @@ -194,7 +194,7 @@ (def!constant static-space-end #x221ff000) (def!constant dynamic-space-start #x22300000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x42300000)) + (def!constant dynamic-space-end (!configure-dynamic-space-end)) (def!constant linkage-table-space-start #x22200000) (def!constant linkage-table-space-end #x222ff000)) @@ -208,7 +208,7 @@ (def!constant static-space-end #x011ff000) (def!constant dynamic-space-start #x09000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x29000000)) + (def!constant dynamic-space-end (!configure-dynamic-space-end)) (def!constant linkage-table-space-start #x01200000) (def!constant linkage-table-space-end #x012ff000)) @@ -222,7 +222,7 @@ (def!constant static-space-end #x201ff000) (def!constant dynamic-space-start #x48000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #xA0000000)) + (def!constant dynamic-space-end (!configure-dynamic-space-end)) (def!constant linkage-table-space-start #x20200000) (def!constant linkage-table-space-end #x202ff000)) @@ -236,7 +236,7 @@ (def!constant static-space-end #x011ff000) (def!constant dynamic-space-start #x58000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x98000000)) + (def!constant dynamic-space-end (!configure-dynamic-space-end)) (def!constant linkage-table-space-start #x01200000) (def!constant linkage-table-space-end #x012ff000)) @@ -250,7 +250,7 @@ (def!constant static-space-end #x1b1ff000) (def!constant dynamic-space-start #x40000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x5bfff000)) + (def!constant dynamic-space-end (!configure-dynamic-space-end)) (def!constant linkage-table-space-start #x1b200000) (def!constant linkage-table-space-end #x1b2ff000)) @@ -264,7 +264,7 @@ (def!constant static-space-end #x201ff000) (def!constant dynamic-space-start #x60000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x98000000)) + (def!constant dynamic-space-end (!configure-dynamic-space-end)) ;; In CMUCL: 0xB0000000->0xB1000000 (def!constant linkage-table-space-start #x20200000) @@ -280,7 +280,7 @@ (def!constant static-space-end #x041ff000) (def!constant dynamic-space-start #x10000000) - (def!constant dynamic-space-end (!configure-dynamic-space-end #x6ffff000)) + (def!constant dynamic-space-end (!configure-dynamic-space-end)) (def!constant linkage-table-space-start #x04200000) (def!constant linkage-table-space-end #x042ff000)) -- 1.7.10.4