Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @ 4095:bca17e38de00
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
Summary: Select number of GC threads dynamically based on heap usage and number of Java threads
Reviewed-by: johnc, ysr, jcoomes
author | jmasa |
---|---|
date | Tue, 09 Aug 2011 10:16:01 -0700 |
parents | 5a5ed80bea5b |
children | 441e946dc1af |
comparison
equal
deleted
inserted
replaced
4094:3a298e04d914 | 4095:bca17e38de00 |
---|---|
666 _cfls(sp), _collector(collector) {} | 666 _cfls(sp), _collector(collector) {} |
667 }; | 667 }; |
668 | 668 |
669 // We de-virtualize the block-related calls below, since we know that our | 669 // We de-virtualize the block-related calls below, since we know that our |
670 // space is a CompactibleFreeListSpace. | 670 // space is a CompactibleFreeListSpace. |
671 | |
671 #define FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(ClosureType) \ | 672 #define FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(ClosureType) \ |
672 void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr, \ | 673 void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr, \ |
673 HeapWord* bottom, \ | 674 HeapWord* bottom, \ |
674 HeapWord* top, \ | 675 HeapWord* top, \ |
675 ClosureType* cl) { \ | 676 ClosureType* cl) { \ |
676 if (SharedHeap::heap()->n_par_threads() > 0) { \ | 677 bool is_par = SharedHeap::heap()->n_par_threads() > 0; \ |
678 if (is_par) { \ | |
679 assert(SharedHeap::heap()->n_par_threads() == \ | |
680 SharedHeap::heap()->workers()->active_workers(), "Mismatch"); \ | |
677 walk_mem_region_with_cl_par(mr, bottom, top, cl); \ | 681 walk_mem_region_with_cl_par(mr, bottom, top, cl); \ |
678 } else { \ | 682 } else { \ |
679 walk_mem_region_with_cl_nopar(mr, bottom, top, cl); \ | 683 walk_mem_region_with_cl_nopar(mr, bottom, top, cl); \ |
680 } \ | 684 } \ |
681 } \ | 685 } \ |
1923 assert(chunk->isFree() && ffc->isFree(), "Error"); | 1927 assert(chunk->isFree() && ffc->isFree(), "Error"); |
1924 _bt.split_block((HeapWord*)chunk, chunk->size(), new_size); | 1928 _bt.split_block((HeapWord*)chunk, chunk->size(), new_size); |
1925 if (rem_size < SmallForDictionary) { | 1929 if (rem_size < SmallForDictionary) { |
1926 bool is_par = (SharedHeap::heap()->n_par_threads() > 0); | 1930 bool is_par = (SharedHeap::heap()->n_par_threads() > 0); |
1927 if (is_par) _indexedFreeListParLocks[rem_size]->lock(); | 1931 if (is_par) _indexedFreeListParLocks[rem_size]->lock(); |
1932 assert(!is_par || | |
1933 (SharedHeap::heap()->n_par_threads() == | |
1934 SharedHeap::heap()->workers()->active_workers()), "Mismatch"); | |
1928 returnChunkToFreeList(ffc); | 1935 returnChunkToFreeList(ffc); |
1929 split(size, rem_size); | 1936 split(size, rem_size); |
1930 if (is_par) _indexedFreeListParLocks[rem_size]->unlock(); | 1937 if (is_par) _indexedFreeListParLocks[rem_size]->unlock(); |
1931 } else { | 1938 } else { |
1932 returnChunkToDictionary(ffc); | 1939 returnChunkToDictionary(ffc); |