Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.OutOfMemoryError: GC overhead limit exceeded

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

like image 551
Sunitha G Avatar asked Nov 08 '22 19:11

Sunitha G


1 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.

like image 78
drmariod Avatar answered Nov 15 '22 06:11

drmariod