We are noticing that our customer
running Solaris 10 is having Permanent
GC grow from 50% to 97% of capacity.
Was there a significant code change in your customer's application prior to noticing the spike in perm gen? Or has it always been like this (going from 50% to 97%)?
I guess it doesn't really matter at this point, but in some cases, spikes like this should be detectable during system testing (assuming your team has visibility in your customers' system testing cycle.)
One thing for certain is that running at 97% is way too much close to the max for comfort, and you will have to play with the max perm gen parameters (and as a consequence with other heap parameters... most likely.)
This JVM was using the default value
of "permgen" (we did NOT pass any
custom Permgen FLAG to the JVM).
Not a good idea. You should (read must) always characterize your (or your customers) applications before deployment. Either your customers should tell you what params they need, or your team must determine those during UAT and system test cycles (assuming you have visibility on those; see above.)
Should we think that anytime soon, it could do a OutOfMemoryError ?
It is not an inevitability, but it is a possibility (especially if the app has not been subjected to the max possible load yet.) It is also possible if the spike is a recent phenomenon. In that case, due, most likely, to a code change, or a previously unknown condition due to other factors (a patch in the OS, in the container, change in customer traffic, change in the db, etc.)
Instead of running at 97% permgen
space in production, should we set a
higher value of PermGen ?
IMO, yes. If you (or your customer) can characterize or estimate the app's memory (both perm and heap) requirements (as well as current and possible future traffic), you should give yourself a 10%-20% margin, just in case. Anything less is just playing with fire. Anything more most likely will be wasteful.
Memory might be cheap, but application performance and stability are not ;)
If you haven't use visualgc, you should. It's a good tool to visually inspect what's going with the different segments in your JVM memory. There is also visualvm, which is more powerful and versatile, yet, the visualgc UI presentation of readings is specifically suitable for this task.
P.S : we're using JDK 1.6.0_23 on
solaris 10.
I don't think that should matter. What is your application container (if your app is running in one.) You might want to edit your post to include this.