Skip to content

Commit

Permalink
select gc column by name+1 (fixes #240)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Mar 25, 2021
1 parent 0ad38f0 commit 68c03c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# head

* Fix bug where max memory reporting by `gc()` may be in different column (#240)

# v 0.8.95

* We are now using _ZeroMQ_ via `Rcpp` in preparation for `v0.9` (#151)
Expand Down
4 changes: 3 additions & 1 deletion R/worker.r
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,12 @@ worker = function(master, timeout=getOption("clustermq.worker.timeout", 600),
run_time = proc.time() - start_time

message("shutting down worker")
gc = gc()
max_mb = which(colnames(gc) == "max used") + 1
zmq$send(list(
id = "WORKER_DONE",
time = run_time,
mem = sum(gc()[,6]),
mem = sum(gc[,max_mb]),
calls = counter,
auth = auth
))
Expand Down

0 comments on commit 68c03c8

Please sign in to comment.