Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Maximum possible Perm size and noclassgc

843811Mar 4 2005 — edited Mar 11 2005
Hi,

We're becoming a bit concerned about topping out the JVM's perm size. Our application has grown over the past 5 1/2 years and the current aggregate size of all of our classes plus third party libraries is around 198m.

We're currently running JDK 1.4.2_06 under Windows 2003 Server. It appears to allow a maximum perm size of 256m.

It took us a pretty long time to determine the mysterious OutOfMemory exceptions we were getting even though we had 600m of general heap space available. Turned out that all those classes had filled up our allocated perm space, leading to OutOfMemory on classload or JIT compile. We've increased our max perm to 256m and our application now fits, but just barely.

The sticky issue is that we run with -noclassgc on since we are pretty heavy users of the Singleton pattern for static reference data. In years past we have had serious issues with the vm garbage collecting static classes (that may have had their data loaded at server startup, not at static initialization, leaving the static classes empty and useless when the classloader reloads them).

My question is twofold.

1) Is it now safe to run with classgc on in modern JVMs? And if it is safe, would it help us? I've seen some conflicting information on this.

The most troubling version is that even with class gc on, the gc will not collect classes until every class in the parent classloader is un-referenced. This would make turning on class gc useless since we run a single application in our app server and have all of maybe 4 classloaders system wide, all of which live forever.

2) Do any other JVM's offer more perm space for us to play with. We are already considering a switch to a 64bit platform since we are starting to feel a little tight in general heap. (The Windows JDK maxs us out at around 1.2gigs or so)

If we upgraded to say the Solaris VM, or the AMD64, do we get more than 256m of perm space to play with along with the additional headroom for heap?


I've had trouble finding information on this stuff, and its surprising to me. Surely we can't be the only shop out there with a couple of hundred megs of application class files and Singleton issues. How have other shops dealt with this limitation? I suppose that we could create a singleton registry bound to JNDI, but as you could imagine, refactoring can be a bit unweildy in a codebase of our size.


Thanks,
-Adam Malter
Senior Programmer
TradeCard Inc.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2005
Added on Mar 4 2005
11 comments
707 views