2
votes

I'm going to lead with some specific questions that I have, and follow them with the context:

  • How can I control how GWT Code Validation in eclipse is configured?
  • What all does GWT Code Validation do?
  • When it is scanning java classes, does it do any class loading?
  • Why is it scanning classes that are not in client/shared packages? And how can I make it stop?

I am running Eclipse Juno. Recently another member of my team upgraded our project from GWT 2.4 to 2.5, and the first effect that I noticed was that GWT Code Validation would consume resources, bring my workspace to a halt, and ultimately fail with a java heap error – forcing me to kill eclipse.

Mind you, I had what should be plenty of heap configured in my eclipse.ini, specifically: -Xms256m -Xmx1536m

Nevertheless, to regain control over my workspace I unchecked Project --> Build Automatically, configured eclipse to display heap usage using Preferences --> General --> Show Heap Status, and bumped up my heap size in eclipse.ini to -Xms2048m -Xmx3072m just as an experiment to see what would happen.

After doing this, I opened eclipse again and allowed it to build automatically, paying careful attention to the progress bar when it was doing the GWT Code Validation phase, and to the heap size: it climbed, and climbed, and climbed, finally peaking somewhere north of 2G consumed. Eventually, it completed (although it took way too long, not at all a reasonable amount of time). Within a minute after it was done, a huge garbage collection event brought the heap down to a mere 300 megabytes.

What I saw under the progress bar was more interesting: the GWT Code Validation appeared to be scanning every *.java file in my entire project: not just those that are in client and shared packages, but everything. I saw class names that the GWT complier would never see in a million years.

So it appears that, while the GWT Compiler is smart enough to start with entry-point GWT module files and search out from there, the GWT Code Validation process appears to do a brute-force search through everything.

And god help it if it's doing any class-loading along the way. Some of these old server-side classes contain ancient sins of my forefathers, connecting to external resources in static initializers and whatnot.

Is there some way that I can configure this validation to be more parsimonious about what it scans?

2
Thats impressive analysis. We just unchecked and avoided GWT validation from normal auto build. Preferences -> Validation -> Suspend All Validators. We prefer GWT compiler doing the validation on our build machine rather than having GWT validation running on work station. Would be keen to see if this Q/A thread comes up with any other solution.appbootup

2 Answers

1
votes

I was going through Eclipse Validator documentation. It states that project build validators can allow configurable filters. http://www.eclipse.org/webtools/wst/components/validation/ValidationOverview.html

However i cannot find anything relevant on GPE source code for it @ http://code.google.com/p/google-plugin-for-eclipse/source/search?q=validator&origq=validator&btnG=Search+Trunk

Meanwhile we are sticking to Disabling All Validation from eclipse using Preferences -> Validation -> Suspend All Validators.

0
votes

You should disable validation of your compiled JavaScript files. This helps with the Eclipse performance issue: https://stackoverflow.com/a/19909401/1040124