What Java IDE VM arguments do YOU use?
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.
- Login or register to post comments
- 7511 reads
- Flag as offensive
- Printer-friendly version
(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 - 12:51pm
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 - 1: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 - 7: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 - 8: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 - 3: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 - 2:10pm
-Tim
Fred Grott replied on Sat, 2008/01/26 - 10: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 - 11:18am
in response to: fg82183
Hi Fred,
Great question! The
-XX:+UseParallelGCflag enables what is known as the Throughput Collector, and is described on the Garbage Collection Tuning Guide:Cheers,
Jim Bethancourt
President, Houston Java Users Group
Technical Architect, ROME Corporation
Robert Sinner replied on Fri, 2008/02/29 - 7:31pm
My eclipse .ini settings are:
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.XXPermSize
128m
-vmargs
-Xms128m
-Xmx768m
-XX:+UseParallelGC
Also recently I read these posts and turned off paging in windows and my ide performance has improved and I have had no wierd other problems with out of memory errors or anything like that.