Jim has posted 11 posts at DZone. View Full User Profile

What Java IDE VM arguments do YOU use?

01.21.2008
| 56015 views |
  • submit to reddit

Java based IDEs are really impressive these days, but developers may quickly find themselves running up against a wall (or worse, constant crashes!) with memory settings they are shipped with.

I would like to find out what VM Arguments YOU use for your IDE, be it Eclipse, IntelliJ, NetBeans, or JDeveloper, or whatever the Java-based IDE is that you use, and the reasons/rationale for your choice.

I had the good fortune a while back of coming across a posting by Ed Burnette of what VM Arguments he found most useful for Eclipse

I have found his suggestion of -vmargs -XX:+UseParallelGC coupled with -XX:MaxPermSize=256m to be highly effective for both Eclipse and IntelliJ.

Using the Sun JVM, my IntelliJ memory settings are as follows:

-XX:+UseParallelGC
-XX:MaxPermSize=256m
-ea

and for Eclipse I use (again, on the Sun JVM)

-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:+UseParallelGC

 

Update: Kelly O' Hair posted a great blog entry with VM argument suggestions for NetBeans 6:

netbeans_default_options="-J-Xms256m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m
-J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-XX:+UseConcMarkSweepGC
-J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled"

 

Granted, I'm not trying to collect any JVM debug information, but that's just me. With dual core machines and 2 GB of memory finally becoming more affordable, having / using a parallel GC and lots of memory is now actually a realizable reality on the desktop too, and is really nice.

Your assignment, should you accept it, is to share the BEST java VM arguments for the ide(s) you use and the kind of JVM you use, and the reason / rationale for using it, even if it is an entire paragraph's worth of vm arguments. Good luck.


Jim Bethancourt
President, Houston Java Users Group -- www.hjug.org

P.S. - Be sure to use the "Quote" style to style your VM Args so others can find them easily and quickly.

Published at DZone with permission of its author, Jim Bethancourt.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Rick Ross replied on Mon, 2008/01/21 - 11:51am

Matt and I almost always load IntelliJ IDEA and Eclipse up with more memory than they default to. This is actually a bit of a pain to do on IDEA for Macintosh because you have to go into the package file and find the options in an obscure place. Worse, they don't persists, so when you put in an updated version of IDEA you lose the settings and need to remember to do it again.

If we are simply not doing it right, then I would love to know the preferred method.

Rick

Ann Oreshnikova replied on Mon, 2008/01/21 - 12:41pm

For IntelliJ IDEA, you might also want to play with the "-server" option. It will most likely affect the startup, but the overall performance may improve.

As usual, fully depends on the environment... :-)

Maris Orbidans replied on Mon, 2008/01/21 - 6:43pm

I have read that concurrent low pause (CMS) collector  (+XX:UseConcMarkSweepGC) is better than The Throughput Collecto.  For example, here http://www.coldfusionmuse.com/index.cfm/2005/10/28/jvm.gc. Also NetBeans configuration FAQ recommends to use CMS

Alex Epshteyn replied on Mon, 2008/01/21 - 7:22pm

If you're on Windows, turning off the system paging file makes the most difference in IDE performance.

Don't bother trying the GC options that the OP mentioned. They won't make any difference if your paging file is being used.

I tried tuning my IntelliJ params for months without much improvement and then realized that the biggest enemy of Java apps on Windows is the paging file. It really makes a HUGE difference. The reasons for that take a while to explain. Just try it for yourself and see. (You should have 1.5+ Gigs of RAM for this)

Here's how:

http://www.codinghorror.com/blog/archives/000422.html

Zviki Cohen replied on Wed, 2008/01/23 - 2:10am

I hate to nag, but since I switched over to Mac OS X I don't bother anymore. I'm doing Eclipse plug-in development. It is not uncommon for me to have 3 instances or Eclipse running at the same time, not to mention everything else running in the backgournd (even virtualized Windows Vista). Works like a charm. I really don't care.

My hardware: MacBook Pro 2.4 GHz C2D, 2GB Memory.

 

Tim Boudreau replied on Wed, 2008/01/23 - 1:10pm

I used to use -XX:CompileThreshold=400 - this will slow down IDE startup mightily, but performance is snappier once it is up and running.

-Tim

Fred Grott replied on Sat, 2008/01/26 - 9:55pm

 Now, I will not mention tha tI just swiched to a dual core cpu workstation..whooops :)

 What does -XX:+UseParallelGC do?? as I have yet ot use that one..

 

I imagine turning off paging on non dual core cpu systems is effective..on dual core you do not even have to bother..:)

 

 

Fred Grott(aka shareme) sometimes a JavaZone(JavaLobby) and EclipseZone contributor. Top visited blog on Jroller.com at: http://www.jroller.com/shareme/

Jim Bethancourt replied on Tue, 2008/01/29 - 10:18am in response to: Fred Grott

Hi Fred,

Great question!  The -XX:+UseParallelGC flag enables what is known as the Throughput Collector, and is described on the Garbage Collection Tuning Guide:

The throughput collector is a generational collector similar to the serial collector but with multiple threads used to do the minor collection. The major collections are essentially the same as with the serial collector. By default on a host with N CPUs, the throughput collector uses N garbage collector threads in the minor collection. 


Cheers,
Jim Bethancourt
President, Houston Java Users Group
Technical Architect, ROME Corporation

Michael Mary replied on Wed, 2009/01/14 - 5:05am

Hello,

 A newbie question I assume but.... Where do you mention this VM arguments (either windows or linux...) ?

For instance, I want to get rid off loading screen of Eclipse under Windows and under Linux but I don't know how to.

 

Thank you

 

Michael

Jacy Grannis replied on Sat, 2009/02/07 - 12:33pm

I've played around extensively with different settings (I know this is an old thread, but for those who get here via web searches like I just did...).  Here's some settings I have settled on, running IntelliJ with jdk 1.6.0.11:

-server -Xms256m -Xmx1024m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+ExplicitGCInvokesConcurrent -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:MaxPermSize=200m -XX:+AggressiveOpts -Dawt.useSystemAAFontSettings=lcd -ea

Obviously my usage of the server VM does not optimize for the start-up time of the JVM, but, I keep the IDE open all week, I'd rather have it perform well over time than optimize the start up time.  The client VM is great for when you don't care about the performance of the app--I expect most developers don't feel that way about their IDE.

Also, I default the min heap size to something larger than the default b/c I find the JVM is a little too aggressive in keeping the heap size down, it impacts performance adversely if I do not set a minimum size to something palatable.

eugene base replied on Wed, 2009/06/17 - 9:51am

EditiX has realtime XPath location and syntax error detection. Helpers are also provided with context syntax popup supporting DTD, Schema and RelaxNG. EditiX supports multiple templates and project management. User can apply XSLT or FO Transformation and show the result with a dedicated view. thanks, knowledge base

Desmond Riverba... replied on Wed, 2014/01/22 - 11:38am

Low cost pet insurance can provide peace of mind even when you cannot afford more complete coverage. The most horrific veterinarian bills are produced by emergency procedures after your pet has had an accident. Low Cost Pet Insurance

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.