Skip to content

Commit 5c11a43

Browse files
committed
corrected memory measurement
1 parent df55324 commit 5c11a43

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: batchtools
22
Title: Tools for Computation on Batch Systems
3-
Version: 0.9.10
3+
Version: 0.9.10-9000
44
Authors@R: c(
55
person("Michel", "Lang", NULL, "michellang@gmail.com",
66
role = c("cre", "aut"), comment = c(ORCID = "0000-0001-9754-0393")),

R/doJobCollection.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ doJobCollection.JobCollection = function(jc, output = NULL) {
125125
# setup memory measurement
126126
measure.memory = isTRUE(jc$resources$measure.memory)
127127
catf("### [bt%s]: Memory measurement %s", s, ifelse(measure.memory, "enabled", "disabled"))
128+
if (measure.memory) {
129+
memory.mult = c(if (.Machine$sizeof.pointer == 4L) 28L else 56L, 8L)
130+
}
128131

129132
# try to pre-fetch some objects from the file system
130133
reader = RDSReader$new(n.jobs > 1L)
@@ -141,7 +144,7 @@ doJobCollection.JobCollection = function(jc, output = NULL) {
141144
if (measure.memory) {
142145
gc(reset = TRUE)
143146
result = try(execJob(job))
144-
update$mem.used = sum(gc()[, 6L])
147+
update$mem.used = sum(gc()[, 6L] * memory.mult)
145148
} else {
146149
result = try(execJob(job))
147150
}

0 commit comments

Comments
 (0)