-2

Why full gc is happening every 4000 sec even though young gen, tenured gen and perm gen have free space.

GC Parameters:

-XX:CMSInitiatingOccupancyFraction=50  
-XX:+UseCMSInitiatingOccupancyOnly  
-XX:+UseConcMarkSweepGC  
-XX:+UseParNewGC  
-Xloggc:GC.log  
-XX:+PrintGCDetails  
-XX:+PrintTenuringDistribution  
-XX:MaxTenuringThreshold=8  
-XX:PermSize=128M  
-XX:MaxPermSize=128M  
-XX:+CMSPermGenSweepingEnabled  

jvm args:

-Xms25G -Xmx25G

The gc logs are:

22463.534: [GC 22463.534: [ParNew
Desired survivor size 8716288 bytes, new threshold 3 (max 8)
- age   1:    3725848 bytes,    3725848 total
- age   2:    3199384 bytes,    6925232 total
- age   3:    2962800 bytes,    9888032 total
: 150702K->15367K(153344K), 0.0343470 secs] 5647083K->5515157K(26197376K), 0.0344540 secs] [Times: user=0.21 sys=0.00, real=0.04 secs]
22476.236: [GC 22476.236: [ParNew
Desired survivor size 8716288 bytes, new threshold 3 (max 8)
- age   1:    4130920 bytes,    4130920 total
- age   2:    3110336 bytes,    7241256 total
- age   3:    3125208 bytes,   10366464 total
: 151687K->16210K(153344K), 0.0357830 secs] 5651477K->5519299K(26197376K), 0.0358820 secs] [Times: user=0.22 sys=0.00, real=0.04 secs]

**22478.730: [Full GC (System) 22478.730: [CMS: 5503089K->4624468K(26044032K), 33.8259070 secs] 5560326K->4624468K(26197376K), [CMS Perm : 12045K->11957K(131072K)], 33.8260340 secs] [Times: user=33.38 sys=0.06, real=33.83 secs]**

22513.164: [GC 22513.164: [ParNew
Desired survivor size 8716288 bytes, new threshold 8 (max 8)
- age   1:    4477888 bytes,    4477888 total
: 136320K->9674K(153344K), 0.0734160 secs] 4760788K->4634143K(26197376K), 0.0735590 secs] [Times: user=0.55 sys=0.00, real=0.08 secs] 
22522.765: [GC 22522.766: [ParNew
Desired survivor size 8716288 bytes, new threshold 8 (max 8)
- age   1:    3725528 bytes,    3725528 total
- age   2:    4220800 bytes,    7946328 total
: 145994K->8939K(153344K), 0.0226740 secs] 4770463K->4633407K(26197376K), 0.0228130 secs] [Times: user=0.15 sys=0.00, real=0.03 secs] 
Abhishek
  • 3
  • 2

1 Answers1

1

One possible explanation is that something is calling System.gc() periodically. It could be your code, or it could be library code that you are using; e.g. System.gc() calls by core APIs.

You could test this theory by setting the java option that tells the JVM to ignore System.gc() calls, and see if the full GCs stop happening. (The option I'm alluding to is -XX:+DisableExplicitGC ... thanks Frank.)

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • @Abhishek The hint is the "(System)" part after "Full GC". You can try either -XX:+DisableExplicitGC, or one of one of -XX:ExplicitGCInvokesConcurrent and -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses. – Frank Pavageau Oct 06 '12 at 14:13
  • This fixed the problem. I think RMI was causing explicit system.gc(). Thanks for the help. – Abhishek Oct 07 '12 at 16:57