I recently came across this error "java.lang.OutOfMemoryError: Java heap space" when accessing large data sets from Mongodb with the RMongo package.
Try to increase java Heap size(sufficient), by using:
options(java.parameters = "-Xmx3g")Make sure that you are setting the Java parameters before any JVM is initialized, i.e. before packages are loaded.
options(java.parameters = "-Xmx3g")Make sure that you are setting the Java parameters before any JVM is initialized, i.e. before packages are loaded.
That means on the R shell run
First: > options(java.parameters = "-Xmx3g")
Second: > RMongo
Thank you very much!
ReplyDeleteYou've just saved my day: I've been struggled with this error since yesterday evening (I thought I would have had to make some dangerous change to some esoteric environmental variable in my fresh-new ubuntu)