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?