13

I am developing an application with GWT and GAE. When I try to rebuild it or create an artifact I get a lot of errors shown below in the picture.

I searched google and Stack Overflow and I got some answers but not to my particular problem.

From what I understand I get the error because my garbage collector consumes a lot of memory.

enter image description here

here is the main error Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded.

Adelin
  • 18,144
  • 26
  • 115
  • 175

6 Answers6

14

OK, I fixed the problem. just increase the memory that the virtual machine needs to compile the project. Previously it was 128 and now I change it be 512. as my project grown it needed more memory to compile the classes of the project.Here is how to do that in Injtellj IDEA. right click on the project module -> open module settings -> Modules -> GWT -> compiler maximum heap size (Mb) -> changed to 512.

enter image description here

NOTE: In Ideal Intellij 12+ The project settings is in : File -> Project Structure OR Ctrl+Alrt+Shitf+S

Adelin
  • 18,144
  • 26
  • 115
  • 175
  • 2
    +1 Awesome, thanks! Apparently I was configuring another (and wrong) "compiler limit" property... – Jovan Perovic Jul 05 '13 at 09:54
  • but where can this option be seen in eclipse juno in linux. I had encountered this same error but cannot change my limit property – lulu May 13 '14 at 08:14
  • checkout chopu answer ! – Adelin May 13 '14 at 14:48
  • where is ' open module settings' in Android Studio? What do you mean by 'project module'?. Please help, I'm not able to find it. Looks like you work on Linux, what is it named on Windows? – Shirish Herwade Jun 21 '17 at 13:04
  • @ShirishHerwade I've attached a screenshot, if you can't find it in windows just search in google how it can be found, the interface of Intellij changes from version to another and from OS to another, please do some search online, I can't give a solution for every version for every OS :) – Adelin Mar 20 '20 at 08:13
4

I had encountered the same problem

Exception in thread “main” java.lang.OutOfMemoryError: GC overhead limit exceeded 

and when I tried to fix this error it showed the same error. So don't panic and just increase size a little more by setting this option in Run->Run Configurations->Click on arguments->inside VM arguments type

 -Xms1024M -Xmx2048M

Xms- for minimum limit

Xmx- for maximum limit

chopss
  • 771
  • 9
  • 19
2

Adio's answer is correct, except that I needed to change it to 1000Mb when we added the "gwt-mobile" library - 512 Mb was still giving me the "GC overhead limit" error. I think 128Mb is a pretty poor default - that didn't work for us even when we began writing our app.

Tim Cooper
  • 10,023
  • 5
  • 61
  • 77
1

Changing the config through the project properties in netbeans didn't work.

My solution was to edit the nbproject/gwt.properties with:

# Additional JVM arguments for the GWT compiler
gwt.compiler.jvmargs=-Xmx1024M
MazarD
  • 2,759
  • 2
  • 22
  • 33
0

I tried all the suggestions in a number of posts on the net and none of them worked. After much experimenting, in the end I found that using the G1GC garbage collector on OSX made a big difference for me. If you are using ANT then you must make sure the build file launches the compiler with the G1GC garbage collector

0

In NetBeans 8.2 do the following

Right click on Project Name -> Properties -> Google Web Toolkit

Modify JVM Arguments to -Xmx512M

Click Ok

Run again

This work for me on Windows 10, Netbeans 8.2, GWT 2.8.2, JDK 1.8

javo_O-
  • 11
  • 1