guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: Log more information about heap size when loading derivation info


From: Christopher Baines
Subject: 02/02: Log more information about heap size when loading derivation info
Date: Mon, 5 Sep 2022 10:03:33 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit 076331325a4037240c0db138619412ca44ee43f4
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Mon Sep 5 14:23:10 2022 +0100

    Log more information about heap size when loading derivation info
    
    To better understand the memory usage when this is happening.
---
 guix-data-service/jobs/load-new-guix-revision.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix-data-service/jobs/load-new-guix-revision.scm 
b/guix-data-service/jobs/load-new-guix-revision.scm
index e684ea0..1deef87 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -854,7 +854,14 @@ WHERE job_id = $1")
                  (expt 2. 20))))
 
      (format (current-error-port)
-             "inferior heap size: ~a MiB~%"
+             "inferior heap: ~a MiB used (~a MiB heap)~%"
+             (round
+              (/ (inferior-eval
+                  '(let ((stats (gc-stats)))
+                     (- (assoc-ref stats 'heap-size)
+                        (assoc-ref stats 'heap-free-size)))
+                  inf)
+                 (expt 2. 20)))
              (round
               (/ (inferior-eval '(assoc-ref (gc-stats) 'heap-size) inf)
                  (expt 2. 20))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]