garbage collector locks up

to make it short:
tomcat, arguments:
-Xmx513m
-Xms512m
-server
-XX:+UseParNewGC
-XX:+CMSParallelRemarkEnabled
-XX:+UseConcMarkSweepGC
-XX:+PrintGCDetails
-verbosegc
-XX:+CMSPermGenSweepingEnabled
-XX:+CMSClassUnloadingEnabled

runs fine for a while, then prints:

[GC [1 CMS-initial-mark: 261312K(516096K)] 261420K(524224K), 0.0008936 secs]
[CMS-concurrent-mark: 0.673/0.673 secs]
[CMS-concurrent-preclean: 0.000/0.000 secs]
[GC[YG occupancy: 107 K (8128 K)][Rescan (parallel) , 0.0034411 secs][weak refs processing, 0.0000064 secs][class unloading, 0.0214873 secs][scrub symbol & string tables, 0.0053496 secs] [1 CMS-remark: 261312K(516096K)] 261420K(524224K), 0.0353675 secs]
[CMS-concurrent-sweep: 0.186/0.186 secs]
[CMS-concurrent-reset: 0.009/0.009 secs]

over and over again, consuming 50% of my hyperthreading p4.

sometimes i get:
[Full GC [CMS (concurrent mode failure): 261308K->261317K(516096K), 1.3826536 secs] 261493K->261317K(524224K), [CMS Perm : 65535K->65534K(65536K)], 1.3828157 secs]
[GC [1 CMS-initial-mark: 261317K(516096K)] 261317K(524224K), 0.0008784 secs]
[Full GC [CMS[CMS-concurrent-mark: 0.621/0.623 secs]
(concurrent mode failure): 261317K->261315K(516096K), 2.0470819 secs] 261502K->261315K(524224K), [CMS Perm : 65535K->65535K(65536K)], 2.0472546 secs]
[Full GC [CMS (concurrent mode failure): 261315K->261315K(516096K), 1.1678882 secs] 261368K->261315K(524224K), [CMS Perm : 65535K->65535K(65536K)], 1.1680489 secs]
[GC [1 CMS-initial-mark: 261315K(516096K)] 261315K(524224K), 0.0011766 secs]
[Full GC [CMS[CMS-concurrent-mark: 0.686/0.686 secs]
(concurrent mode failure): 261315K->261314K(516096K), 1.9247622 secs] 261368K->261314K(524224K), [CMS Perm : 65535K->65535K(65536K)], 1.9249726 secs]
[Full GC [CMS (concurrent mode failure): 261314K->261314K(516096K), 1.2463526 secs] 261314K->261314K(524224K), [CMS Perm : 65535K->65535K(65536K)], 1.2464900 secs]
[GC [1 CMS-initial-mark: 261314K(516096K)] 261314K(524224K), 0.0008861 secs]

again and again. whats wrong?

Hmm. all the -XX flags are “use at your own risk”. My guess is you have a combination of them that is causing the VM to do someting bad.

But exactly what that combination is, I wouldn’t know. Maybe one of the VM guys like Ken or Azim will take a loo kat your post and have more to say.

Otherwise Id just start eliminating -XX flags and see where the problem goes away.

You’ll probably get better answers if you post on the JVM forum on forum.java.sun.com.

It looks to me at least in the second case that you’ve loaded a ton of classes. You might want to try increasing the perm gen size with -XX:MaxPermSize=128m or similar.

is 3000+ a ton?

3000+ classes?

yes, >3000 different classses
actually, it’s > 3000 files, so it’s even more.

It’s hard to tell. I think NetBeans increases the perm gen size on the command line and they load some 5000+ classes.

I thought the perm gen size automatically resized as necessary anyway?

Cas :slight_smile:

Only up to a certain maximum, just like the rest of the heap. The default MaxPermSize is 64 MB.