Eclipse + GWT & # 8594; Not enough memory in design mode

If I run the GWT application in eclipse in development mode and have been in the browser for some time, I always get an "out of memory" error in eclipse. My computer has 16 GB of memory, and never uses more than 8 GB.

I tried several configuration options. The VM arguments in my Run configuration contain the following parameters: "-Xms8192m -Xmx8192m"

Even in eclipse.ini, I tested several configuration options, and now it looks like this:

--launcher.XXMaxPermSize 8192M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 8192m --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.6 -Xms8192m -Xmx8192m 

But I still get the error. Is there any way to prevent this?

+4
source share
3 answers

If the browser application throws an OutOfMemoryError , you do not need to change the Eclipse settings (eclipse.ini), which are only for Eclipse itself (more memory, usually faster than the workstation).

To increase the application memory (any Java application launched from Eclipse), go to Run/Debug configurations... in the Run menu and set VM arguments on the Arguments tab in the application configuration:

 -Xms128M -Xmx1024M -XX:MaxPermSize=256M 
+7
source

put this in vm arguments in your startup configurations: -Xmx2048M -XX: MaxPermSize = 512 m

+1
source

If I run the GWT application in eclipse in development mode and have been in the browser for some time, I always get an "out of memory" error in eclipse.

It's not clear what the problem is, but I see some problems with your current arguments.

  • You have two launcher arguments that match. You do not need a second entry:

     --launcher.XXMaxPermSize 8192M 
  • I really doubt that you want 8g PermSize. Something like 512m is probably much better. You can use jconsole to find out how much memory is in real space. In the image below, taken from the jconsole memory tab, the panel highlighted in the lower right shows the β€œPerm Gen” space. It currently uses 26,906 KB (or about 27 MB). This is where the code goes, and it often needs to be increased if you have many JSP pages that also compile.

    enter image description here

    If you run your application with the following options, you can connect to jconsole to find out how to do this:

     -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false 

    I suspect that you will see that you are using far, much less in the space of the Perm General. -Xmx8192m (or -Xmx8g ) is all you need. This will give 8 GB of memory for the heap in general, which is usually short-lived objects. It also scales various sections of memory accordingly.

For more information about the various heap spaces, see the Java hotspot documentation .

0
source

Source: https://habr.com/ru/post/1498844/


All Articles