Print this page

        

@@ -1833,11 +1833,11 @@
 void CompactibleFreeListSpace::object_iterate_since_last_GC(ObjectClosure* cl) {
   // ugghh... how would one do this efficiently for a non-contiguous space?
   guarantee(false, "NYI");
 }
 
-bool CompactibleFreeListSpace::linearAllocationWouldFail() {
+bool CompactibleFreeListSpace::linearAllocationWouldFail() const {
   return _smallLinearAllocBlock._word_size == 0;
 }
 
 void CompactibleFreeListSpace::repairLinearAllocationBlocks() {
   // Fix up linear allocation blocks to look like free blocks

@@ -1904,10 +1904,17 @@
     blk->_word_size = fc->size();
     fc->dontCoalesce();   // to prevent sweeper from sweeping us up
   }
 }
 
+// Support for concurrent collection policy decisions.
+bool CompactibleFreeListSpace::should_concurrent_collect() const {
+  // In the future we might want to add in frgamentation stats --
+  // including erosion of the "mountain" into this decision as well.
+  return !adaptive_freelists() && linearAllocationWouldFail();
+}
+  
 // Support for compaction
 
 void CompactibleFreeListSpace::prepare_for_compaction(CompactPoint* cp) {
   SCAN_AND_FORWARD(cp,end,block_is_obj,block_size);
   // prepare_for_compaction() uses the space between live objects