1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Thu Jun 12 14:23:34 2008 -0700 1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed Jun 18 18:36:47 2008 -0700 1.3 @@ -1004,6 +1004,9 @@ 1.4 1.5 DEBUG_ONLY(mark_bitmap()->verify_clear();) 1.6 DEBUG_ONLY(summary_data().verify_clear();) 1.7 + 1.8 + // Have worker threads release resources the next time they run a task. 1.9 + gc_task_manager()->release_all_resources(); 1.10 } 1.11 1.12 void PSParallelCompact::post_compact() 1.13 @@ -1949,12 +1952,6 @@ 1.14 TimeStamp compaction_start; 1.15 TimeStamp collection_exit; 1.16 1.17 - // "serial_CM" is needed until the parallel implementation 1.18 - // of the move and update is done. 1.19 - ParCompactionManager* serial_CM = new ParCompactionManager(); 1.20 - // Don't initialize more than once. 1.21 - // serial_CM->initialize(&summary_data(), mark_bitmap()); 1.22 - 1.23 ParallelScavengeHeap* heap = gc_heap(); 1.24 GCCause::Cause gc_cause = heap->gc_cause(); 1.25 PSYoungGen* young_gen = heap->young_gen(); 1.26 @@ -1969,6 +1966,10 @@ 1.27 PreGCValues pre_gc_values; 1.28 pre_compact(&pre_gc_values); 1.29 1.30 + // Get the compaction manager reserved for the VM thread. 1.31 + ParCompactionManager* const vmthread_cm = 1.32 + ParCompactionManager::manager_array(gc_task_manager()->workers()); 1.33 + 1.34 // Place after pre_compact() where the number of invocations is incremented. 1.35 AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); 1.36 1.37 @@ -2008,7 +2009,7 @@ 1.38 bool marked_for_unloading = false; 1.39 1.40 marking_start.update(); 1.41 - marking_phase(serial_CM, maximum_heap_compaction); 1.42 + marking_phase(vmthread_cm, maximum_heap_compaction); 1.43 1.44 #ifndef PRODUCT 1.45 if (TraceParallelOldGCMarkingPhase) { 1.46 @@ -2039,7 +2040,7 @@ 1.47 #endif 1.48 1.49 bool max_on_system_gc = UseMaximumCompactionOnSystemGC && is_system_gc; 1.50 - summary_phase(serial_CM, maximum_heap_compaction || max_on_system_gc); 1.51 + summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc); 1.52 1.53 #ifdef ASSERT 1.54 if (VerifyParallelOldWithMarkSweep && 1.55 @@ -2067,13 +2068,13 @@ 1.56 // code can use the the forwarding pointers to 1.57 // check the new pointer calculation. The restore_marks() 1.58 // has to be done before the real compact. 1.59 - serial_CM->set_action(ParCompactionManager::VerifyUpdate); 1.60 - compact_perm(serial_CM); 1.61 - compact_serial(serial_CM); 1.62 - serial_CM->set_action(ParCompactionManager::ResetObjects); 1.63 - compact_perm(serial_CM); 1.64 - compact_serial(serial_CM); 1.65 - serial_CM->set_action(ParCompactionManager::UpdateAndCopy); 1.66 + vmthread_cm->set_action(ParCompactionManager::VerifyUpdate); 1.67 + compact_perm(vmthread_cm); 1.68 + compact_serial(vmthread_cm); 1.69 + vmthread_cm->set_action(ParCompactionManager::ResetObjects); 1.70 + compact_perm(vmthread_cm); 1.71 + compact_serial(vmthread_cm); 1.72 + vmthread_cm->set_action(ParCompactionManager::UpdateAndCopy); 1.73 1.74 // For debugging only 1.75 PSMarkSweep::restore_marks(); 1.76 @@ -2084,16 +2085,14 @@ 1.77 compaction_start.update(); 1.78 // Does the perm gen always have to be done serially because 1.79 // klasses are used in the update of an object? 1.80 - compact_perm(serial_CM); 1.81 + compact_perm(vmthread_cm); 1.82 1.83 if (UseParallelOldGCCompacting) { 1.84 compact(); 1.85 } else { 1.86 - compact_serial(serial_CM); 1.87 + compact_serial(vmthread_cm); 1.88 } 1.89 1.90 - delete serial_CM; 1.91 - 1.92 // Reset the mark bitmap, summary data, and do other bookkeeping. Must be 1.93 // done before resizing. 1.94 post_compact();