I am trying to use bartMachine as part of a larger package, but I'm struggling against Java memory management.
When used inside a package, I never run library(bartMachine) and even if the java.parameters option is set up, the information is never passed to the java machine underneath.
Trying to emulate the loading of the package I run:
after setting the memory option. But nevertheless running rJava::.jcall(rJava::.jnew("java/lang/Runtime"), "J", "maxMemory") / 1e9 after it shows me the default amount of memory.
To give more info, this is my workflow:
First check if java.parameters is set, if not set up, ask the user to choose an amount of memory to use.
Then there's the .jpackage() code as above, but I'm not sure it's doing anything.
If not done already, the user chooses the number of cores to use.
the Bart model is run
I extract the posterior from it using bart_machine_get_posterior()
I extract the variable importance using get_var_props_over_chain() which is where I get the memory problem:
<OutOfMemoryError/VirtualMachineError/Error/Throwable/Object/Exception/error/condition>
Error in `.jcall(bart_machine$java_bart_machine, "[D", "getAttributeProps",
type)`: java.lang.OutOfMemoryError: Java heap space
Is it possible to use bartMachine inside a package without loading and attaching it?
Hello!
I am trying to use bartMachine as part of a larger package, but I'm struggling against Java memory management.
When used inside a package, I never run
library(bartMachine)
and even if thejava.parameters
option is set up, the information is never passed to the java machine underneath.Trying to emulate the loading of the package I run:
after setting the memory option. But nevertheless running
rJava::.jcall(rJava::.jnew("java/lang/Runtime"), "J", "maxMemory") / 1e9
after it shows me the default amount of memory.To give more info, this is my workflow:
java.parameters
is set, if not set up, ask the user to choose an amount of memory to use..jpackage()
code as above, but I'm not sure it's doing anything.bart_machine_get_posterior()
get_var_props_over_chain()
which is where I get the memory problem:Is it possible to use bartMachine inside a package without loading and attaching it?