SWT Designer OutOfMemoryError

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

SWT Designer OutOfMemoryError

Postby dizzy » Sun Oct 10, 2010 9:54 pm

Hi,

I am using the SWT Designer under Eclipse Helios Service Release 1 20100917-0705 on a MacBook Pro 2.53 GHz Core i5 with 4GB RAM running Mac OS X Version 10.6.4.

I have tried both the current stable release of SWT Designer and the current beta version (8.0.0.r36x20101008C).

Using both versions, when I switch to the Design view for a ViewPart that I want to design, Eclipse quickly grinds to a halt and becomes unresponsive, with the Mac Activity Monitor showing CPU usage over 100%. However, I have no problems with using Eclipse generally, as long as I don't go near the SWT Designer!

The Eclipse .log file shows no errors. However, if I run Eclipse with the -debug option and hit control-C when the unresponsiveness begins, I get an error as follows:

Code: Select all
java.lang.OutOfMemoryError: Java heap space
   at org.eclipse.core.internal.jobs.JobListeners.newEvent(JobListeners.java:66)
   at org.eclipse.core.internal.jobs.JobListeners.aboutToRun(JobListeners.java:142)
   at org.eclipse.core.internal.jobs.JobManager.startJob(JobManager.java:1466)
   at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:218)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)
Exception in thread "[Timer] - Periodical Task (Bundle 127) (Bundle 127)" java.lang.OutOfMemoryError: Java heap space
   at java.lang.String.toCharArray(String.java:2725)
   at java.lang.Thread.setName(Thread.java:1069)
   at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:90)
Exception in thread "[Timer] - Main Queue Handler" java.lang.OutOfMemoryError: Java heap space


I don't see any other error messages.

I have already sent the following properties in my eclipse.ini file, but these have not resolved the problem:
-XX:MaxPermSize=256m
-Xms512m
-Xmx1g

Can anyone suggest what to try next?


Thanks,
dizzy
dizzy
 
Posts: 3
Joined: Sun Oct 10, 2010 9:36 pm

Re: SWT Designer OutOfMemoryError

Postby Eric Clayberg » Mon Oct 11, 2010 5:30 am

What does your Eclipse Heap Status indicator show during all of this?

WHat exact JVM are you using?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: SWT Designer OutOfMemoryError

Postby dizzy » Tue Oct 12, 2010 5:34 am

Hi Eric,

The heap status indicator shows the memory usage rapidly growing as soon as I enter the the 'Design' view, until the full memory is used up.

Then I get an error like this:
Code: Select all
Unhandled event loop excepton

Java heap space


Here is my JVM:
Code: Select all
$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)
dizzy
 
Posts: 3
Joined: Sun Oct 10, 2010 9:36 pm

Re: SWT Designer OutOfMemoryError

Postby Eric Clayberg » Tue Oct 12, 2010 6:08 am

How much memory does it show being used initially and how much before you get the heap space error?

Can you provide a test case that will trigger this?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: SWT Designer OutOfMemoryError

Postby dizzy » Wed Oct 13, 2010 5:20 am

Eric,

The initial memory usage is about 120M. This rises to 1G before the heap space error occurs.

I'm afraid I don't have a test case I can provide, but I have identified a cause (though I'm not sure what to do about it).

My project makes use of a large set of classes generated via Axis2 from a WSDL. The classes are generated as nested classes within a single .java file, which is very large. All of the views that are causing me this problem import one or more of the nested classes from this .java file. If I comment out the file from the list of imports, the problem is resolved!

So there must be some logic within the SWT Designer that is doing some parsing of my included classes. Does this sound correct? If so, is there a recommended way of avoiding this kind of problem? I could probably extract the required data into some simpler object and import that, but is there a suggested approach?


Thanks,
dizzy
dizzy
 
Posts: 3
Joined: Sun Oct 10, 2010 9:36 pm

Re: SWT Designer OutOfMemoryError

Postby Eric Clayberg » Wed Oct 13, 2010 5:28 am

You could use code hiding tags or Beans.isDesignTime() checks to hide code from the parser.

Custom components used by a UI are loaded by the VM used to run Eclipse, so you could have a problem if one or more of them consumes an enormous amount of memory for some reason.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

cron