Use a dedicated fiber for heap size monitoring
This commit is contained in:
parent
46b86761f5
commit
f1071cbd4d
1 changed files with 17 additions and 6 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue