src/hotspot/share/gc/g1/g1FullCollector.cpp
changeset 58777 18c246ad2ff9
parent 57777 90ead0febf56
--- a/src/hotspot/share/gc/g1/g1FullCollector.cpp	Thu Oct 24 15:53:20 2019 +0800
+++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp	Thu Oct 24 11:08:16 2019 +0200
@@ -198,13 +198,17 @@
   // Recursively traverse all live objects and mark them.
   GCTraceTime(Info, gc, phases) info("Phase 1: Mark live objects", scope()->timer());
 
-  // Do the actual marking.
-  G1FullGCMarkTask marking_task(this);
-  run_task(&marking_task);
+  {
+    // Do the actual marking.
+    G1FullGCMarkTask marking_task(this);
+    run_task(&marking_task);
+  }
 
-  // Process references discovered during marking.
-  G1FullGCReferenceProcessingExecutor reference_processing(this);
-  reference_processing.execute(scope()->timer(), scope()->tracer());
+  {
+    // Process references discovered during marking.
+    G1FullGCReferenceProcessingExecutor reference_processing(this);
+    reference_processing.execute(scope()->timer(), scope()->tracer());
+  }
 
   // Weak oops cleanup.
   {