-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reports of large memory usage on workers #240
Comments
This happens sometimes, but I haven't tracked it down yet. Can you show me your output of |
Sure, here is the same packageVersion("clustermq")
#> [1] '0.8.95.1'
options(clustermq.scheduler = "multiprocess")
f <- function(x) 2 * x
o <- clustermq::Q(f, x = 1:2, n_jobs = 2)
#> Starting 2 processes ...
#> Running 2 calculations (0 objs/0 Mb common; 1 calls/chunk) ...
#> Master: [0.7s 13.6% CPU]; Worker: [avg 60.0% CPU, max 2541187.0 Mb]
gc()
#> used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
#> Ncells 780210 41.7 1446692 77.3 NA 1446692 77.3
#> Vcells 1446396 11.1 8388608 64.0 16384 2464813 18.9 Created on 2021-03-25 by the reprex package (v1.0.0) |
Ok, the reason for this is that I try to use the For me, used (Mb) gc trigger (Mb) max used (Mb)
Ncells 688430 36.8 1248045 66.7 1248045 66.7
Vcells 1268353 9.7 8388608 64.0 2350433 18.0 and here column 6 is correct. It does look, however, that this is not always column 6. A better way to get this would be: --- a/R/worker.r
+++ b/R/worker.r
@@ -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
)) |
Confirmed fixed, thanks! packageVersion("clustermq")
#> [1] '0.8.95.1'
options(clustermq.scheduler = "multiprocess")
f <- function(x) 2 * x
o <- clustermq::Q(f, x = 1:2, n_jobs = 2)
#> Starting 2 processes ...
#> Running 2 calculations (0 objs/0 Mb common; 1 calls/chunk) ...
#> Master: [0.9s 12.6% CPU]; Worker: [avg 58.3% CPU, max 250.7 Mb] Created on 2021-03-25 by the reprex package (v1.0.0) By the way, are you still using the |
Thanks for confirming! I've got a couple of commits lined up for develop, but they are part of a larger change so I haven't pushed them yet. |
The following reprex reports large memory usage on the workers. Does it really go up to 2541405.0 Mb?
Created on 2021-03-24 by the reprex package (v1.0.0)
Session info
The text was updated successfully, but these errors were encountered: