October 25, 2007 3

Eclipse The Memory Hog – resolved!

By Max in Java

A couple of months back I made a blog entry about Eclipse and its memory settings. I wrote it because so many people complained that even when they put memory flags in their eclipse.ini Eclipse was still a memory hog and it crashed all the time. The entry blog explains how fragile eclipse.ini is and how to write it correctly and verify that it is picked up correctly.

That helped many, but suddenly I was starting to see more and more blogs, jira issues, forum postings, phone calls, personal assaults etc. about Eclipse memory usage sucking and our users started having memory issues with the latest builds and releases of JBoss Tools.

Why were so many seeing memory issues on a release that actually should use less memory than the previous one ?

As it turns out, on top of the issues with eclipse.ini from my previous entry, Eclipse 3.3.1 introduced a major bug in parsing the settings in eclipse.ini that resulted in PermGen memory settings not being set correctly on Sun Java VM’s!

Result: Eclipse 3.3.1 runs “fine” at first, but as soon as you start having larger projects and/or using additonal plugins you are bound to get OutOfMemoryExceptions!

Thankfully eclipse.org is now in the process of doing a respin of Eclipse 3.3.1 and the first build is now available for testing.

So what do you do if you like your Eclipse 3.3.1 and don’t want to try the build from above ?

You have a couple of options:

  • Use the *exact* settings described in my previous blog – they are not affected by the Eclipse 3.3.1 bug
  • Use Red Hat Developer Studio which automatically uses the settings described in my blog
  • Use another VM, only Sun’s and Apple’s VM requires the PermGen setting; IBM’s and JRockIt JVM allocates PermGen space dynamically
October 17, 2007 3

Visual Page Editor updated – now with MacOSX support

By Max in JBoss Tools and devstudio

We now got nightly builds for JBoss Tools that uses the Eclipse 3.3 compatible XULRunner from Eclipse ATF/Mozilla.org instead of our older version of Mozilla in the Visual Page Editor (VPE).

So, what does this mean for our users ?

  1. VPE will use less resources on windows since we don’t have to load Mozilla twice
  2. VPE won’t crash your Eclipse on Linux because you tried to use the internal browser in Eclipse or did code completion with Java doc context help enabled
  3. VPE will now work on Mac OSX!

So in short everybody wins !

Note that this is very new and fresh (especially the Mac OSX support is experimental) so any feedback you can provide on things that breaks or is erroring will be very much welcome in our jira or forum! (we would also like to hear if it just worked ;)

Thanks goes out to Sergey Vasilyev (Exadel) and his team on doing the development for this, Phillipe Ombredanne (NexB) and the ATF team for making the XULRunner available in a standalone version and to Marshall Culpepper (JBoss) for getting our build adjusted! Thanks again!

October 8, 2007 0

Red Hat Developer Studio Beta2 released

By Max in JBoss Tools and devstudio

We made Red Hat Developer Studio 1.0.0.beta2 available at
http://www.redhat.com/developers/rhds/index.html

Red Hat Developer Studio is a set of eclipse-based development tools that are pre-configured for JBoss Enterprise Middleware Platforms.

It currently bundles JBoss EAP 4.2, Eclipse 3.3, latest JBossTools plugins plus other plugins relevant for JBoss development.

Whats new and noteworthy for Red Hat Developer Studio (and JBoss Tools) can be found at
http://docs.jboss.org/tools/whatsnew/

September 18, 2007 0

We are hiring!

By Max in JBoss Tools and devstudio

Do you have Eclipse RCP/plugin development experience and want to work with the JBoss Tools and Red Hat Developer Studio team on creating the best opensource IDE for JBoss AS and Seam development ?

Then checkout these new positions:

Job 1, Job 2, Job 3

August 13, 2007 2

Red Hat Developer Studio Beta 1 released

By Max in JBoss Tools and devstudio

Today we are releasing Red Hat Developer Studio Beta 1:

Go get your own copy here.

Red Hat Developer Studio beta 1 is the full bundle and includes:

  • Installer
  • Eclipse 3.3
  • Eclipse Web Tools Platform 3.3
  • JBoss Enterprise Application Platform 4.2
  • JBoss Tools beta 3

Download urls for JBoss Tools beta 3 will be posted/announced later when the filecopying completes ;)

July 5, 2007 1

Who needs an iPhone anyway…

By Max in Java
Get a decent phone $20
+ GMail Mobile $0
+ Google Calendar $0
+ GooSync $0 to $19.95
+ Opera Mini beta 4 $0

Result

The real web, e-mail and synchronized calendar on a mobile device without having to sell your soul to the Apple mania ;)

Especially GooSync and Opera Mini beta 4 is what makes this experience enjoyable!

What would make it perfect…

GooSync should add the option of syncing the description and comments, currently it is only the time, title and notification that is sync’ed.
Opera Mini should include something like the “Wand” from it’s big-brother Opera to fill in forms (which is a pain on a desktop, but horriable on any phone).

June 25, 2007 3

Exadel Plugins are now opensourced

By Max in JBoss Tools and devstudio

Yesterday evening we finally made the commit of Exadel Plugins to JBoss Tools SVN and during the night the nightly builds were generated and I encourage you to try them out and give us feedback.

This was a big team effort and I thanks everyone involved from San Francisco, Concord, Dallas, New York, London, Antwerpen, Neuchatel, Minsk, Moscow to Brisbane (and surely others which city I forgot) for stepping up when needed.

Special thanks goes to:

Denis Golovin & Alexey Kazakov and their development team for doing the hard work with preparing the source code for opensourcing
Marshall Cullpepper for all the work done, especially integrating the JBoss IDE and Exadel Studio builds
Alexey Morlender and his QA team for filling up JIRA and keeping us busy
Bryan Che, Igor Shabalov and Theresa Kelsey for pushing JIRA and Red Hat Helpdesk to it’s limits
Mark Webbink & Sacha Labourey for all the talks about open source licenses
and finally Greg Katzman for introducing me to “Russian Sauna”

Remember that this is just the first step of many, follow and/or join us at jboss.org/tools

June 18, 2007 0

Todays favorite tool: svnmerge.py

By Max in Java

I was about to have fun merging our two branches in rhdevstudio, the Eclipse 3.3 branch onto main trunk, when I remembered Emmanuel whining about the false promise of svn and all the issues he had. His issues were apparently partially because of his IDE but probably mainly because svn surprisingly does not keep track of merges by default.

Luckily I remembered noticing svnmerge.py the other day and tried using it today.

It is great and I don’t need an PhD to use it (keeping The SVN Book near by is though still recommended :)

svnmerge init [theotherbranch + possible revision info] on the two branches you want to merge (if you did a svn copy initially the revision info is not needed)

svnmerge avail to see the revisions that are available for merges

svnmerge merge [piecemal revisions] to do the merge either piecemal or one big merge.

The wonderfull thing is that svnmerge uses svn properties to keep track on which revisions you have already applied and from where.
Making the merge info easily available and future additional merges trivial.

Excellent!

note: the only thing i’m annoyed about with respect to svn is that the actual svn merge or svn diff seem to be extremely heavy operations – or at least very little informative about its progress even with the verbose flag ;(

June 8, 2007 9

Eclipse 3.2 should we stay or should we go to Eclipse 3.3 ?

By Max in JBoss Tools and devstudio

Eclipse 3.3 and WTP 2.0 is planned to be released soon and I’m considering if we should move now or later.

Previous major Eclipse upgrades have been smooth for me as an user, but a *pain* as a plugin developer since many of the API’s I’ve needed to integrate with WTP DOM and JDT changed. Of course that was all my own fault since I am and were using internal API, but hey what can I do when there is no public DOM editor API and previously there where no public java code completion API ?

Luckily, Hibernate Tools seem to be running just fine under Eclipse 3.3/WTP 2.0, but as you all know we got the rest of JBoss IDE and the plugins from Exadel which is now JBoss Tools to also migrate.

From the first look of things it seems like we can migrate 98% of our code base in JBoss Tools without any compilation issues at least, but what is obvious is that when we first do the move we can’t be compatible with Eclipse 3.2 hence we will be Eclipse 3.3 only.

So technically it can be done, but what about our users, will you prefer an Eclipse 3.2/WTP 1.5 or Eclipse 3.3/WTP 2.0 based set of JBoss Tools plugins (and as a consequence Red Hat Developer Studio will also be based on Eclipse 3.3/WTP 2.0) ?

There is also the whole issue about checking if the behavior is the same even though the API did not change…

June 1, 2007 23

Eclipse and memory settings

By Max in Uncategorized

Updated 03.08.07: eclipse.ini is sensitive to which line break is used. See Eclipse bug#198823

Many users seem to have problems with running out of memory when using Eclipse 3.2 in combination with additonal plugins such as those from JBoss Tools or even Eclipse WTP.

For those who just want the solution scroll down to the bottom, you can skip my “rant” about it.

The Problem

Eclipse default memory settings (at least for Eclipse 3.2) is to run with the following memory settings specified in its eclipse.ini file:

-vmargs
-Xms40m
-Xmx256m

This is ok for most users, but users can tweak these settings by editing eclipse.ini or via the command line, e.g.

eclipse -vmargs -Xms128m -Xmx512m

This would give some more room for extra many open projects and/or using plugins that might need additional memory (e.g. query results when running HQL via Hibernate Tools).

So why am I blogging about this ?

Well, it turns out that the combination of a eclipse.ini’s weird syntax and Sun JVM’s ‘alternative’ memory handling can give alot of headache.

Eclipse.ini

eclipse.ini is a configuration file that is located in the root of your Eclipse installation which is used as the default arguments passed to Eclipse.

This is all nice, but it is so easy to make it have zero effect by doing what makes the most sense, namely putting all the arguments on a single line in your eclipse.ini:

-vmargs -Xms128m -Xmx512m

The above line is simply ignored (or just not parsed correctly) by eclipse and hence the JVM is just started with the Sun VM default memory settings and the user thinks everything is fine.
The *correct* way of using eclipse.ini is to put each command line argument on individual lines:

-vmargs
-Xms128m
-Xmx512m

The best way to know if your command line arguments actually has been passed in correctly is to go to Help/About [Product Name] and click “Configuration Details” and check that the property “eclipse.vmargs” contain the values you expected.

This is expected and *correct*:

eclipse.vmargs=-Xms512m
-Xmx512m
-jar
/opt/eclipse32-3.2.2/startup.jar

This is *not*:

eclipse.vmargs=-jar
/opt/eclipse32-3.2.2/startup.jar

And that is exactly what happens when you put everything on one line in .eclipse.ini, so be careful!

Sun JVM PermGen

Sun JVM’s has a concept of PermGen space that is a *seperate* allocated memory region that is used for e.g. allocating classes. This is actually the memory region most people have issues with and not so much the normal heap space, but as a normal user one have a hard time realizing this when eclipse (or rather the jvm) just says “Out of Memory” or simply just crashes.

The solution for this is to add a MaxPermSize value to the vmargs. e.g. I normally use -XX:MaxPermSize=128m to make sure I don’t run out of PermGen space.

The Solution

*shameless plug*: Get Red Hat Developer Studio when it is relased which does this automatically for you, or…

Increase the memory settings via command line or eclipse.ini:

Command line

eclipse -vmargs -Xms128m -Xmx512m -XX:MaxPermSize=128m

Eclipse.ini

The trick is to remember each argument has to be on seperate lines:

-vmargs
-Xms128m
-Xmx512m
-XX:MaxPermSize=128m

Other solutions

Use a JVM that uses the normal heap for PermGen-like allocations (that is any non-Sun JVM AFAIK)
or help out with reducing the memory footprint of your favorite plugins by running them through a profiler and report found issues or possibly even contribute patches to the Jira :)

Related links

Igor’s blog about using jconsole to debug memory issues with Eclipse
Sun blog with nice explanation of PermGen and what might cause it in user code
Eclipse Program Launcher documentation
JBoss Tools/RHDS forum post that made me want to write this blog