From 2d2cc26fca4675bbd3b10e483383e01ef38fc06c Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sun, 5 Oct 2014 22:10:46 +0200 Subject: [PATCH] Allow setting dynamic space size easily at build time, fix #112. --- INSTALL.md | 9 +++++++++ Makefile | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 32b96ba..5e23018 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -62,3 +62,12 @@ It's possible to pick [ccl](http://ccl.clozure.com/) rather than SBCL when compiling pgloader: make CL=ccl + +## Building pgloader for use in low RAM environments + +It's possible to tweak the size of RAM pgloader will use in its binary +image, ac compile time. This defaults to 4 GB. + + make DYNSIZE=1024 + +Now the `./build/bin/pgloader` that you get only uses 1GB. diff --git a/Makefile b/Makefile index aa2fdff..bd5c97a 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ VERSION = 3.1.0 # use either sbcl or ccl CL = sbcl +# default to 4096 MB of RAM size in the image +DYNSIZE = 4096 + LISP_SRC = $(wildcard src/*lisp) \ $(wildcard src/pgsql/*lisp) \ $(wildcard src/sources/*lisp) \ @@ -111,7 +114,7 @@ $(PGLOADER): $(MANIFEST) $(BUILDAPP) $(LISP_SRC) --load-system $(APP_NAME) \ --load src/hooks.lisp \ --entry pgloader:main \ - --dynamic-space-size 4096 \ + --dynamic-space-size $(DYNSIZE) \ $(COMPRESS_CORE_OPT) \ --output $@ @@ -123,7 +126,7 @@ pgloader-standalone: --require sb-rotate-byte \ --load-system pgloader \ --entry pgloader:main \ - --dynamic-space-size 4096 \ + --dynamic-space-size $(DYNSIZE) \ --compress-core \ --output $(PGLOADER)