mlr-org / parallelMap

R package to interface some popular parallelization backends with a unified interface
https://parallelmap.mlr-org.com
Other
57 stars 14 forks source link

Set options for child processes #36

Closed filipre closed 5 years ago

filipre commented 8 years ago

Hi,

It seems like that I can't set options like options(java.parameters = "-Xmx30g") for a child process after using parallelStartSocket(6). One of my functions uses Java as a backend and uses more than the default 512mb as a heap. Therefore I always recieve following error:

00002: Error in .jcall("weka/filters/Filter", "Lweka/core/Instances;", "useFilter",  : 
  java.lang.OutOfMemoryError: Java heap space

While the common solution is to set a higher Java heap space (which works if I do not use parallelMap), I have trouble to do that using parallelMap.

$ jps -lvm

user@server:~/mlr-filter$ jps -lvm
48000  -Xmx512m -Xrs vfprintf exit
47991  -Xmx512m -Xrs vfprintf exit
47964  -Xmx512m -Xrs vfprintf exit
44541  -Xmx30g -Xrs vfprintf exit

$ top:

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
48000 user   20   0 3228m 1.3g  14m R  220  0.5   1:56.40 R
47964 user   20   0 3228m 1.3g  14m R  219  0.5   2:13.66 R
47991 user   20   0 3228m 1.3g  14m R  217  0.5   1:58.92 R
44541 user   20   0 34.8g 1.4g  20m S    1  0.6   9:33.01 rsession
[...]

so it looks like that my rsession does have the 30 GB but the child processes do not. I tried to use options(java.parameters = "-Xmx30g") at the top of my R file and after calling parallelStartSocket(6) but both did not work. Also, I tried to call .jinit(force.init = TRUE) but it had no effect either.

Any simple solution to my problem?

Thanks!

pat-s commented 5 years ago

Unfortunately we do not have enough resources to tackle this niche case right now. Also this might not be specific to parallelMap but will most likely be a generic problem of JAVA usage for PSOCK clusters.