Skip to content

Add support for CCL --heap-reserve option #31

Description

@dimitri

It is documented at https://ccl.clozure.com/manual/chapter16.1.html and is comparable to --dynamic-space-size in SBCL I think. Following up on problems to build pgloader with CCL on dockerhub and travis environments I got the following piece of advice:

rme: The second thing might be to try running ccl with "--heap-reserve 150g". Perhaps the container environment doesn't like ccl's default reservation of 512 gigabytes of address space.

It looks like the following patch would allow buildapp to support --heap-reserve?

modified   buildapp.lisp
@@ -400,7 +400,8 @@ ARGV. See *USAGE* for details."
     (quit))
   (let* ((dumper (command-line-dumper (rest argv)))
          (*package* (find-package :buildapp))
-         #+sbcl (dynamic-space-size (dynamic-space-size dumper)))
+         #+sbcl (dynamic-space-size (dynamic-space-size dumper))
+         #+ccl  (heap-reserve (heap-reserve dumper)))
     (with-tempfile (stream ("dumper.lisp" file))
       (write-dumpfile dumper stream)
       (force-output stream)
@@ -415,6 +416,11 @@ ARGV. See *USAGE* for details."
                                       (list "--dynamic-space-size"
                                             (princ-to-string
                                              dynamic-space-size)))
+                                    #+ccl
+                                    (when heap-reserve
+                                      (list "--heap-reserve"
+                                            (princ-to-string
+                                             heap-reserve)))
                                     #+sbcl "--noinform"
                                     #+ccl  "--quiet"
                                     #+sbcl "--disable-debugger"
modified   command-line.lisp
@@ -160,6 +160,8 @@
              (push entry (dispatched-entries plan))))
           (:dynamic-space-size
            (setf (dynamic-space-size plan) (parse-integer value)))
+          (:heap-reserve
+           (setf (heap-reserve plan) (parse-integer value)))
           (t
            (error 'unknown-argument :flag argument)))))))
 
modified   dumper.lisp
@@ -86,6 +86,10 @@
    (dynamic-space-size
     :initarg :dynamic-space-size
     :accessor dynamic-space-size
+    :initform nil)
+   (heap-reserve
+    :initarg :heap-reserve
+    :accessor heap-reserve
     :initform nil)))
 
 (defgeneric needs-asdf-p (dumper)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions