diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index fbced1d..e499a8b 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -731,17 +731,30 @@ WHERE job_id = $1") (round (/ (assoc-ref (gc-stats) 'heap-size) (expt 2. 20)))) - (with-time-logging - (simple-format #f "getting derivations for ~A" system-target-pair) - (catch - 'match-error - (lambda () - (inferior-eval '(invalidate-derivation-caches!) inf)) - (lambda (key . args) - (simple-format - (current-error-port) - "warning: ignoring match-error from calling inferior invalidate-derivation-caches!\n"))) - (inferior-eval-with-store inf store (proc packages (list system-target-pair))))) + + (format (current-error-port) + "inferior heap size: ~a MiB~%" + (round + (/ (inferior-eval '(assoc-ref (gc-stats) 'heap-size) inf) + (expt 2. 20)))) + + (let ((derivations + (with-time-logging + (simple-format #f "getting derivations for ~A" system-target-pair) + (catch + 'match-error + (lambda () + (inferior-eval '(invalidate-derivation-caches!) inf)) + (lambda (key . args) + (simple-format + (current-error-port) + "warning: ignoring match-error from calling inferior invalidate-derivation-caches!\n"))) + (inferior-eval-with-store inf store (proc packages (list system-target-pair)))))) + + ;; Clean the cached store connections, as there are caches associated + ;; with these that take up lots of memory + (inferior-eval '(when (defined? '%store-table) (hash-clear! %store-table)) inf) + derivations)) (append supported-system-pairs supported-system-cross-build-pairs)))