1

Error : GC overhead limit exceeded (max heap: 1024 MB)

Frequently am getting above error When I do gradle deploy or other gradle operations from command prompt.

Could anyone help me to fix this issue.

Project: Java

Build : Gradle

*This is related to Gradle and Java. not only JAVA

Noobie
  • 31
  • 4

2 Answers2

2

It worked for me and Hope this will help you :

GRADLE_OPTS=-Xmx2048m gradle deploy

Spartan
  • 3,213
  • 6
  • 26
  • 31
0

This type of error (Error : GC overhead limit exceeded) occur by the garbage collector, your GC is taking an excessive amount of time 98% of all CPU time of the process and recovers very little memory in each run only 2% of the heap.

You can try to turn off thi with the command : -XX:-UseGCOverheadLimit

Anshul Sharma
  • 3,432
  • 1
  • 12
  • 17
  • could you please tell me from where I have execute this command? – Noobie Aug 17 '17 at 04:55
  • you can refet below stackover flow link, you can get project answer from this link : Question By : Mnementh, and answer by many java expert : https://stackoverflow.com/questions/1393486/error-java-lang-outofmemoryerror-gc-overhead-limit-exceeded – Anshul Sharma Aug 17 '17 at 04:59