From 4fcb24f448721f6ab307fc2437db0ed0f36a96a7 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 23 Aug 2017 15:58:39 +0200 Subject: [PATCH] Reintroduce manual Garbage Collect in SBCL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems that SBCL still needs some help in deciding when to GC with very large values. In a test case with a “data” column averaging 375kB (up to about 3 MB per datum), it allows much larger batch size and prefetch rows settings without entering lldb. --- src/pgsql/copy-from-queue.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pgsql/copy-from-queue.lisp b/src/pgsql/copy-from-queue.lisp index 3921ec1..d01b0a1 100644 --- a/src/pgsql/copy-from-queue.lisp +++ b/src/pgsql/copy-from-queue.lisp @@ -167,7 +167,11 @@ (let ((batch-seconds (send-current-batch unqualified-table-name))) (incf seconds batch-seconds)) - (setf current-batch (make-batch))) + (setf current-batch (make-batch)) + + ;; give a little help to our friend, now is a good time + ;; to garbage collect + #+sbcl (sb-ext:gc :full t)) (format-row-in-batch copy row current-batch preprocessor pre-formatted)))