7061204: clean the chunk table synchronously in embedded builds
authorjcoomes
Wed, 06 Jul 2011 12:28:07 -0700
changeset 10022 377345fb5fb5
parent 10021 7a7afd351444
child 10023 e99d9a03c0f5
7061204: clean the chunk table synchronously in embedded builds Reviewed-by: dholmes, never, jwilhelm, kvn
hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
hotspot/src/share/vm/memory/defNewGeneration.cpp
hotspot/src/share/vm/memory/genCollectedHeap.cpp
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/runtime/thread.cpp
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Wed Jul 06 12:22:29 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Wed Jul 06 12:28:07 2011 -0700
@@ -2716,6 +2716,10 @@
   bitMapLock()->unlock();
   releaseFreelistLocks();
 
+  if (!CleanChunkPoolAsync) {
+    Chunk::clean_chunk_pool();
+  }
+
   _between_prologue_and_epilogue = false;  // ready for next cycle
 }
 
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp	Wed Jul 06 12:22:29 2011 -0700
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp	Wed Jul 06 12:28:07 2011 -0700
@@ -905,6 +905,10 @@
     to()->check_mangled_unused_area_complete();
   }
 
+  if (!CleanChunkPoolAsync) {
+    Chunk::clean_chunk_pool();
+  }
+
   // update the generation and space performance counters
   update_counters();
   gch->collector_policy()->counters()->update_counters();
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Wed Jul 06 12:22:29 2011 -0700
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Wed Jul 06 12:28:07 2011 -0700
@@ -1384,6 +1384,10 @@
   generation_iterate(&blk, false);  // not old-to-young.
   perm_gen()->gc_epilogue(full);
 
+  if (!CleanChunkPoolAsync) {
+    Chunk::clean_chunk_pool();
+  }
+
   always_do_update_barrier = UseConcMarkSweepGC;
 };
 
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 06 12:22:29 2011 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 06 12:28:07 2011 -0700
@@ -444,6 +444,9 @@
   product(bool, UsePPCLWSYNC, true,                                         \
           "Use lwsync instruction if true, else use slower sync")           \
                                                                             \
+  develop(bool, CleanChunkPoolAsync, falseInEmbedded,                       \
+          "Whether to clean the chunk pool asynchronously")                 \
+                                                                            \
   /* Temporary: See 6948537 */                                             \
   experimental(bool, UseMemSetInBOT, true,                                  \
           "(Unstable) uses memset in BOT updates in GC code")               \
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 06 12:22:29 2011 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 06 12:28:07 2011 -0700
@@ -3347,7 +3347,9 @@
   // Notify JVMTI agents that VM initialization is complete - nop if no agents.
   JvmtiExport::post_vm_initialized();
 
-  Chunk::start_chunk_pool_cleaner_task();
+  if (CleanChunkPoolAsync) {
+    Chunk::start_chunk_pool_cleaner_task();
+  }
 
   // initialize compiler(s)
   CompileBroker::compilation_init();