java.lang.OutOfMemoryError: GC overhead limit exceeded

Viewed 3508

In R Studio using R, when trying to join 2 tables which have about 100k records(DB2 DB), getting below error and none of the google solutions worked.

Error 'in .jcall(x, "S", "getMessage")': java.lang.OutOfMemoryError: GC overhead limit exceeded

2 Answers

I had this problem several times, sometimes randomly. What helped me so far was using the following command at the beginning of the script before loading any other package!

options(java.parameters = c("-XX:+UseConcMarkSweepGC", "-Xmx8192m"))

The -XX:+UseConcMarkSweepGC loads an alternative garbage collector which seemed to make less problems than the standard GC.

if you are using intillij On the main menu, choose File. Invalidate Caches/Restart

Related