Thu, 17 May 2012 21:53:40 +0200
7169062: CMS: Assertion failed with -XX:+ObjectAlignmentInBytes=64
Summary: Removed the assert in CompactibleFreeListSpace::check_free_list_consistency() since it was too strict. Simplified CompactibleFreeListSpace::set_cms_values() to reducde the need for asserts.
Reviewed-by: jcoomes, stefank
src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Fri May 18 14:57:28 2012 -0700 1.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Thu May 17 21:53:40 2012 +0200 1.3 @@ -58,8 +58,11 @@ 1.4 void CompactibleFreeListSpace::set_cms_values() { 1.5 // Set CMS global values 1.6 assert(MinChunkSize == 0, "already set"); 1.7 - #define numQuanta(x,y) ((x+y-1)/y) 1.8 - MinChunkSize = numQuanta(sizeof(FreeChunk), MinObjAlignmentInBytes) * MinObjAlignment; 1.9 + 1.10 + // MinChunkSize should be a multiple of MinObjAlignment and be large enough 1.11 + // for chunks to contain a FreeChunk. 1.12 + size_t min_chunk_size_in_bytes = align_size_up(sizeof(FreeChunk), MinObjAlignmentInBytes); 1.13 + MinChunkSize = min_chunk_size_in_bytes / BytesPerWord; 1.14 1.15 assert(IndexSetStart == 0 && IndexSetStride == 0, "already set"); 1.16 IndexSetStart = MinChunkSize; 1.17 @@ -2534,12 +2537,8 @@ 1.18 " linear allocation buffers"); 1.19 assert(BinaryTreeDictionary<FreeChunk>::min_tree_chunk_size*HeapWordSize == sizeof(TreeChunk<FreeChunk>), 1.20 "else MIN_TREE_CHUNK_SIZE is wrong"); 1.21 - assert((IndexSetStride == 2 && IndexSetStart == 4) || // 32-bit 1.22 - (IndexSetStride == 1 && IndexSetStart == 3), "just checking"); // 64-bit 1.23 - assert((IndexSetStride != 2) || (IndexSetStart % 2 == 0), 1.24 - "Some for-loops may be incorrectly initialized"); 1.25 - assert((IndexSetStride != 2) || (IndexSetSize % 2 == 1), 1.26 - "For-loops that iterate over IndexSet with stride 2 may be wrong"); 1.27 + assert(IndexSetStart != 0, "IndexSetStart not initialized"); 1.28 + assert(IndexSetStride != 0, "IndexSetStride not initialized"); 1.29 } 1.30 #endif 1.31