diff options
author | Christopher Baines <mail@cbaines.net> | 2024-10-27 13:55:16 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-10-27 14:38:50 +0000 |
commit | f1071cbd4d4a5a9a2026fe32e20777cc628f4686 (patch) | |
tree | 90dd70e4d3d840d50ef0ba02927647069eb74cfd | |
parent | 46b86761f522f83b38e9978875750e1eae4d30de (diff) | |
download | data-service-f1071cbd4d4a5a9a2026fe32e20777cc628f4686.tar data-service-f1071cbd4d4a5a9a2026fe32e20777cc628f4686.tar.gz |
Use a dedicated fiber for heap size monitoring
-rw-r--r-- | guix-data-service/jobs/load-new-guix-revision.scm | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index 3db3b9f..f4968de 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -614,12 +614,6 @@ '(define unsupported-cross-compilation-target-error? (const #f)) inf)) - (format (current-error-port) - "heap size: ~a MiB~%" - (round - (/ (assoc-ref (gc-stats) 'heap-size) - (expt 2. 20)))) - (catch 'match-error (lambda () @@ -2588,6 +2582,23 @@ SKIP LOCKED") (exec-query conn "BEGIN") + (spawn-fiber + (lambda () + (while #t + (sleep 30) + + (let ((stats (gc-stats))) + (simple-format + (current-error-port) + "process-job heap: ~a MiB used (~a MiB heap)~%" + (round + (/ (- (assoc-ref stats 'heap-size) + (assoc-ref stats 'heap-free-size)) + (expt 2. 20))) + (round + (/ (assoc-ref stats 'heap-size) + (expt 2. 20)))))))) + (match (select-job-for-update conn id) (((id commit source git-repository-id)) |