runtime JVM options
jamesnichols3 at gmail.com
jamesnichols3 at gmail.com
Fri Dec 12 10:56:30 PST 2008
JBoss won't be able to tell you much, since it really depends a lot on your application memory usage pattern.
If you have an environment where you can reproduce your production load, it's really a wash-rinse-repeat tuning methodology. If you want to contact me offline I can give you a general methodology about what I have done with Jboss, but like I said, it really depends.
Sent from my Verizon Wireless BlackBerry
From: Victor Cheung <VictorC at ganz.com>
Date: Fri, 12 Dec 2008 13:48:09
To: Peter.Kessler at Sun.COM<Peter.Kessler at Sun.COM>
Cc: hotspot-gc-use at openjdk.java.net<hotspot-gc-use at openjdk.java.net>
Subject: RE: runtime JVM options
Okay, I see. You're right, there are lots of history and backward compatibility that need to be preserved. I like the "building the airplane while it's flying" analogy! Lol!
Okay, then I guess we just have to accept the way it is now, and be cognizant that future changes may affect our current JVM configuration. We'll cross that bridge when we come to it!
That's a good point, in my investigations so far I haven't come across JVM tuning information specifically relating to JBoss. I'll do some research on this to see if I can find anything.
From: Peter.Kessler at Sun.COM [mailto:Peter.Kessler at Sun.COM]
Sent: Friday, December 12, 2008 12:47 PM
To: Victor Cheung
Cc: hotspot-gc-use at openjdk.java.net
Subject: Re: runtime JVM options
Victor Cheung wrote:
> Thank You, Peter! I was just testing each option right now to
> determine which lines they print... then I saw your reply! (I kept
> -Xloggc in JBoss, then added each additional option one by one,
> starting JBoss and then stopping, then looking at the gc log file to
> see what the option printed out)
> Our production server has 8 CPUs, 32GB memory.
> Why is "PS YoungGen" = -XX:+UseParallelGC ? I didn't specify to use
> any particular collectors, and after all the reading I did, I would
> have guessed the default young generation collector to be the CMS.
> Is CMS synonymous with "Concurrent Low Pause Collector"? I'm
> somewhat still confused because I'm noticing a lot of the
> JVM/tuning/GC literature are written by different people at different
> times and terms are being interchanged casually as if the reader is
> supposed to know. I'm also trying to filter out what is no longer
> relevant because the JDK has evolved. Sorry to digress.
> Back to my original point, when you said "PS YoungGen" = "parallel
> scavenge" (-XX:+UseParallelGC) this makes sense because of the
> acronym "PS" = "Parallel Scavenge". But if it's true that "PS
> OldGen" = "serial old generation collector" then this is confusing!
> It should be changed to "Serial OldGen". Anyhow, what is the
> difference between -XX:+UseParallelOldGen and -XX:+UseConcMarkSweepGC
> ? From my reading I was leaning toward using -XX:+UseConcMarkSweepGC
> for handling the old generation heap.
HotSpot has 10 years of history built into it. You are right that -XX:+UseParallelGC seems like it ought to turn on parallel young and parallel old collectors. The problem was that we wrote the parallel young collector before we knew how to write the parallel compacting collector. So we needed a flag to turn on the parallel scavenger, and by the time we wrote the parallel compactor customers had gotten used to -XX:+UseParallelGC turning on only the parallel scavenger, so we had to add a new additional flag to turn on the parallel compactor, -XX:+UseParallelOldGC. Backwards compatibility matters. (That's not an excuse for not thinking about forward compatibility when naming flags. Sigh.)
> Wow. The GC output descriptions for CMS is really messed like you
> The whole purpose of me diving into this JVM world (my original goal)
> is to fix the "OutOfMemoryException GC overhead limit exceeded". And
> I'm hoping to find a simple solution to this. One that is not too
> prescriptive in terms of the options needed. Ideally, I do not want
> to have to specify anything related to survivor spaces, the permanent
> generation heap, or anything else but the following:
> - Xms - Xmx - type of young generation collector - type of old
> generation collector - XX:NewRatio (for controlling size of young and
> old generation)
> IMHO, if all there was to tuning the JVM was at most the above,
> everyone would be happy! With so many options available it's really
> flexible, but the price is complexity. From my perspective, this is
> another classic Pandora's Box scenario. Do people out there really
> need to fine-tune JVMs so precisely (how do people get to tinker that
> much with production systems anyhow... because at a certain point it
> becomes an exercise in trial-and-error... and is it worth the
> time/risk/effort in squeezing every last bit of performance from a
> JVM when hardware is cheap these days)? I'm no expert or anything,
> but I really think the design of the JVM tuning options needs to be
> reconsidered (since it seems that the current path is only to add
> more options, not take away). There is value in the old adage "less
> is more", especially when the programming movement is clearly toward
> simplicity (DSLs, meta-programming, dynamic languages, etc.). Java
> needs to be simpler, not more complicated (assuming it's not too late
> I apologize, I'm really digressing. Bed time for me!
> Thanks though, Peter (and everyone else who's helped)!
I completely agree with your sentiments. If we were delivering a new product we might have the luxury of thinking things through and making it all consistent and beautiful. But as they say: we are building the airplane while its flying, so we do what we can without breaking anything crucial (like our customers). As an example: We still get grief over the decision to turn on the parallel scavenger instead of the serial scavenger when running on a multi-processor machine, even though the parallel scavenger out-performs the serial scavenger on any multi-processor. For another example, you might not like it if (when!) we introduce a new collector and decide to make it the default: you will have tuned your application against your hardware (and data!) until you are happy, and then we go and change some policy that makes you have to retune. We would like to move to a style where you describe the qualities of service you need (pause time, throughput, etc.) and we pick the colle
ctor(s) that are right for your application while watching it run. But we aren't there yet. We don't get to know beforehand whether we are running an applet on an old laptop or JBoss on an 8-way machine with 32GB of memory, so we need you to specify some command line options.
For more background reading on the collectors, tuning, blogs, etc., follow the links at http://java.sun.com/javase/technologies/hotspot/gc/index.jsp.
I'd be disappointed if JBoss didn't have some suggestions on how to tune the various JVMs to run their product well. I have no experience with tuning JBoss.
hotspot-gc-use mailing list
hotspot-gc-use at openjdk.java.net
More information about the hotspot-gc-use