United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6976378 ParNew: stats are printed unconditionally in debug builds
JDK-6976378 : ParNew: stats are printed unconditionally in debug builds

Details
Type:
Bug
Submit Date:
2010-08-11
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs19
Fixed Versions:
hs19 (b06)

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
The changes for 6970376 left the statictics printing enabled unconditionally in debug builds.  The extra output caused a nightly test to fail:

nsk/coverage/instanceklass/instanceklass002

                                    

Comments
EVALUATION

Print the stats only when PrintGCDetails and ParallelGCVerbose are enabled, so it works the same way as the parallel scavenge collector.
                                     
2010-08-11
SUGGESTED FIX

diff --git a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
--- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -970,8 +970,10 @@
     gch->print_heap_change(gch_prev_used);
   }
 
-  TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats());
-  TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats());
+  if (PrintGCDetails && ParallelGCVerbose) {
+    TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats());
+    TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats());
+  }
 
   if (UseAdaptiveSizePolicy) {
     size_policy->minor_collection_end(gch->gc_cause());
                                     
2010-08-11
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/2d6b74c9a797
                                     
2010-08-11



Hardware and Software, Engineered to Work Together