Restarting GWT Modlue causes a memory error

I am developing a GWT application and am having problems with development mode testing in eclipse.

When I make changes to the client code, I refresh the browser page (F5) to reload the module. Every time I do this (the code has changed or not), the "Development" tab in eclipse shows a new marker point with "Loaded module xxxx". Also, according to the task manager, every time I do this, the javaw.exe host process increases by about 1 MB of memory. In the end (after 10-20 updates), the page does not load, and this error is displayed on the "Development Mode" tab:

Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)

I can fix this by stopping and restarting the server (not the small update button on the Developer Mode tab, but the Red Stop button), but then the module needs to be reviewed, which takes some time. It seems that the eclipse does not understand that I ended up with the old module when I reboot the new one. I am observing the same behavior with a completely new GWT project, so I don't think this is my code. Does anyone know how to fix this?

EDIT : see both answers below for possible solutions.

+4
source share
2 answers

The default settings of gwt dev are the minimum, so you quickly delete them from memory.

enter image description here

From this you can see that permgenspace is at a low level, and if you update 20 times in a short period of time, it will go out of memory.

You can start by using the following vmargs:

 -Xms512m -Xmx512m -XX:MaxPermSize=256M -XX:+UseParallelGC 

But since Enribo indicated if your application is growing, more memory is required:

 -Xms512m -Xmx1g -XX:MaxPermSize=256M -XX:+UseParallelGC 
+7
source

Actually there is not much that you can do. As you mentioned, you can increase memory, but in the end you will run into the same problem with even more allocated memory.

I suggest you try running Super Dev mode , but in this case you will need to update the SDK that you are using to 2.5.1+ . In Super Dev mode, your browser does not need a plugin, because in fact it will work with true Javascript. You even have the option to debug your browser, but by looking at your Java source (using source maps).

+2
source

All Articles