-1

I'm running a java program using 3GB heap space. After a while I notice this in the gc logs.

Application time: 0.8263100 seconds

2015-03-13T07:24:49.065-0700: 77177.620: [GC Before GC:

Statistics for BinaryTreeDictionary:


Total Free Space: 2960457

Max Chunk Size: 1233864

Number of Blocks: 393

Av. Block Size: 7532

Tree Height: 19

Before GC:

Statistics for BinaryTreeDictionary:


Total Free Space: 0

Max Chunk Size: 0

Number of Blocks: 0

Tree Height: 0

77177.620: [ParNew (0: promotion failure size = 2154) (1: promotion failure size = 2154) (2: promotion failure size = 2154) (3: promotion failure size = 2154) (4: promotion failure size = 2154) (5: promotion failure size = 2154) (6: promotion failure size = 2154) (7: promotion failure size = 2154) (8: promotion failure size = 2154) (10: promotion failure size = 2154) (11: promotion failure size = 2154) (12: promotion failure size = 2154) (13: promotion failure size = 2154) (14: promotion failure size = 2154) (15: promotion failure size = 2154) (16: promotion failure size = 2154) (17: promotion failure size = 2154) (18: promotion failure size = 2154) (19: promotion failure size = 2154) (20: promotion failure size = 2154) (21: promotion failure size = 2154) (22: promotion failure size = 2154) (23: promotion failure size = 2154) (24: promotion failure size = 2154) (25: promotion failure size = 2154) (26: promotion failure size = 2154) (27: promotion failure size = 2154) (promotion failed): 346350K->333366K(393216K), 0.3779580 secs]77177.998: [CMSCMS: Large block 0x00000007b7da3200

: 2156277K->1695244K(2621440K), 11.2619970 secs] 2481226K->1695244K(3014656K), [CMS Perm : 193077K->191199K(256000K)]After GC:

Statistics for BinaryTreeDictionary:


Total Free Space: 118536640

Max Chunk Size: 118536640

Number of Blocks: 1

Av. Block Size: 118536640

Tree Height: 1

After GC:

Statistics for BinaryTreeDictionary:


Total Free Space: 0

Max Chunk Size: 0

Number of Blocks: 0

Tree Height: 0

, 11.6404220 secs] [Times: user=16.85 sys=0.04, real=11.64 secs]

Total time for which application threads were stopped: 11.6432380 seconds

Application time: 0.0421420 seconds

Total time for which application threads were stopped: 0.0189740 seconds

Because of this Full GC, my program was stopped for 11 seconds. It caused a huge performance problem. The thing is, everywhere people are telling [promotion failure = fragmentation]. If that is so, then why is max Chunk size(1233864) before GC still more than all the promotion failure block sizes(2154) combined.

I have check everywhere and not been able to find the cause for this problem.

Does anyone here know the reason why this keeps occurring?

Community
  • 1
  • 1
Vishal
  • 1
  • 3

1 Answers1

1

The biggest concern when using this collector is encountering promotion failures which are instances where a race condition occurs between collecting the young and old generations. If the collector needs to promote young objects to the old generation, but hasn’t had enough time to make space clear it, it will have to do so first which will result in a full STW collection – the very thing this CMS collector was meant to prevent. To make sure this doesn’t happen you would either increase the size of the old generation (or the entire heap for that matter) or allocate more background threads to the collector for him to compete with the rate of object allocation.

Tharif
  • 13,172
  • 9
  • 51
  • 73
  • 1
    Hmm... But if your case(race condition) were to happen, wouldn't I get a concurrent mode failure instead of just a promotion failure. – Vishal Mar 17 '15 at 12:26