Tassos Bassoukos - Eclipse

That wonderful RCP...

Thursday, 08 June 2006

Eclipse and PermGen space...

My home computer is an AMD64 machine, onto which I'd installed the 64-bit version of Ubuntu Dapper, but It was a basic install without any fluff (beyond mythtv, that is). I installed Eclipse on it for some work (specifically, the Callisto R6), but it was interminently thowing OutOfMemory errors.

Specifically it was throwing java.lang.OutOfMemoryError: PermGen space errors, which was a bit baffling, as the memory used by the VM was well below the allowed maximum memory usage. After a bit of googling around, turns out that PermGen is the permanent generation of objects in the VM (Class names, internalized strings, objects that will never get garbage-collected). An easy, if somewhat memory-hungry fix is to enlarge the maximum space for these objects by adding

-XX:PermSize=64m
-XX:MaxPermSize=128m

to the $ECLIPSE_HOME/eclipse.ini file, which has me happily loading all Callisto plugins at the same time(!).

@ Thursday, 08 June 2006, 19:57 in (Eclipse) - 3 comments
Monday, 12 December 2005

Character set that understands property files

If you are a Java developer in a non-ISO8859-1 environment, you will have encountered the character set problem when editing property files. The spec says that they are in ISO8859-1, with Unicode escape sequences for characters outside that set. While one can set up automatic translation, it is intrusive and not suited to all cases. Being fed up with the problem and the inelegance of all the available solutions, I wrote a custom character set provider which handles the property file encoding as a multi-byte character set.

The source is here, and the prebuilt JAR is here. To use the property character set, drop the JAR file in the extension folder of your JRE, usually $JAVA_HOME/lib/ext and restart (or start) your application. Property files should be assigned the "X-PROP" character set, and all should be ready.

If you are using Eclipse 3.1 or later, simply go to Window → Preferences → General → Content Types → Text → Java Properties files, set the default encoding to X-PROP and select Update to apply the setting.

The code is in the public domain, and I'm not responsible if it munges your files, destroys your computer or causes the next ice age, etc...

@ Monday, 12 December 2005, 23:58 in (Eclipse, Software) - comment ?