5

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

trincot
  • 263,463
  • 30
  • 215
  • 251
Sunitha G
  • 119
  • 1
  • 6
  • Possible duplicate of ["Out of Memory Error (Java)" when using R and XLConnect package](https://stackoverflow.com/questions/7963393/out-of-memory-error-java-when-using-r-and-xlconnect-package) – Fredulom Jul 21 '17 at 10:15
  • 1
    did you try `gc(); memory.limit(1e+10) ` ? – quant Jul 21 '17 at 10:26

2 Answers2

1

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.

drmariod
  • 10,480
  • 12
  • 53
  • 107
0

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