< prev index next >

src/hotspot/share/gc/g1/g1FullCollector.cpp

Print this page
@@ -38,10 +38,11 @@
  #include "gc/g1/g1Policy.hpp"
  #include "gc/g1/g1RegionMarkStatsCache.inline.hpp"
  #include "gc/shared/gcTraceTime.inline.hpp"
  #include "gc/shared/preservedMarks.hpp"
  #include "gc/shared/referenceProcessor.hpp"
+ #include "gc/shared/slidingForwarding.hpp"
  #include "gc/shared/verifyOption.hpp"
  #include "gc/shared/weakProcessor.inline.hpp"
  #include "gc/shared/workerPolicy.hpp"
  #include "logging/log.hpp"
  #include "runtime/biasedLocking.hpp"

@@ -306,17 +307,21 @@
    scope()->tracer()->report_object_count_after_gc(&_is_alive);
  }
  
  void G1FullCollector::phase2_prepare_compaction() {
    GCTraceTime(Info, gc, phases) info("Phase 2: Prepare for compaction", scope()->timer());
+ 
+   _heap->forwarding()->clear();
+ 
    G1FullGCPrepareTask task(this);
    run_task(&task);
  
+   // TODO: Disabled for now because it violates sliding-forwarding assumption.
    // To avoid OOM when there is memory left.
-   if (!task.has_freed_regions()) {
-     task.prepare_serial_compaction();
-   }
+   // if (!task.has_freed_regions()) {
+   //   task.prepare_serial_compaction();
+   // }
  }
  
  void G1FullCollector::phase3_adjust_pointers() {
    // Adjust the pointers to reflect the new locations
    GCTraceTime(Info, gc, phases) info("Phase 3: Adjust pointers", scope()->timer());
< prev index next >