2357 guarantee(fc->next() == NULL || fc->next()->prev() == fc, "Broken list"); 2358 guarantee((fc->next() == NULL) == (fc == tail), "Incorrect tail"); 2359 } 2360 guarantee(n == num, "Incorrect count"); 2361 } 2362 2363 #ifndef PRODUCT 2364 void CompactibleFreeListSpace::check_free_list_consistency() const { 2365 assert((TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >::min_size() <= IndexSetSize), 2366 "Some sizes can't be allocated without recourse to" 2367 " linear allocation buffers"); 2368 assert((TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >::min_size()*HeapWordSize == sizeof(TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >)), 2369 "else MIN_TREE_CHUNK_SIZE is wrong"); 2370 assert(IndexSetStart != 0, "IndexSetStart not initialized"); 2371 assert(IndexSetStride != 0, "IndexSetStride not initialized"); 2372 } 2373 #endif 2374 2375 void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { 2376 assert_lock_strong(&_freelistLock); 2377 Log(gc, freelist, census) log; 2378 if (!log.is_debug()) { 2379 return; 2380 } 2381 AdaptiveFreeList<FreeChunk> total; 2382 log.debug("end sweep# " SIZE_FORMAT, sweep_count); 2383 ResourceMark rm; 2384 outputStream* out = log.debug_stream(); 2385 AdaptiveFreeList<FreeChunk>::print_labels_on(out, "size"); 2386 size_t total_free = 0; 2387 for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { 2388 const AdaptiveFreeList<FreeChunk> *fl = &_indexedFreeList[i]; 2389 total_free += fl->count() * fl->size(); 2390 if (i % (40*IndexSetStride) == 0) { 2391 AdaptiveFreeList<FreeChunk>::print_labels_on(out, "size"); 2392 } 2393 fl->print_on(out); 2394 total.set_bfr_surp( total.bfr_surp() + fl->bfr_surp() ); 2395 total.set_surplus( total.surplus() + fl->surplus() ); 2396 total.set_desired( total.desired() + fl->desired() ); 2397 total.set_prev_sweep( total.prev_sweep() + fl->prev_sweep() ); 2398 total.set_before_sweep(total.before_sweep() + fl->before_sweep()); 2399 total.set_count( total.count() + fl->count() ); 2400 total.set_coal_births( total.coal_births() + fl->coal_births() ); 2401 total.set_coal_deaths( total.coal_deaths() + fl->coal_deaths() ); 2402 total.set_split_births(total.split_births() + fl->split_births()); 2403 total.set_split_deaths(total.split_deaths() + fl->split_deaths()); 2404 } 2405 total.print_on(out, "TOTAL"); 2406 log.debug("Total free in indexed lists " SIZE_FORMAT " words", total_free); 2407 log.debug("growth: %8.5f deficit: %8.5f", 2408 (double)(total.split_births()+total.coal_births()-total.split_deaths()-total.coal_deaths())/ 2409 (total.prev_sweep() != 0 ? (double)total.prev_sweep() : 1.0), 2410 (double)(total.desired() - total.count())/(total.desired() != 0 ? (double)total.desired() : 1.0)); 2411 _dictionary->print_dict_census(out); 2412 } 2413 2414 /////////////////////////////////////////////////////////////////////////// 2415 // CompactibleFreeListSpaceLAB 2416 /////////////////////////////////////////////////////////////////////////// 2417 2418 #define VECTOR_257(x) \ 2419 /* 1 2 3 4 5 6 7 8 9 1x 11 12 13 14 15 16 17 18 19 2x 21 22 23 24 25 26 27 28 29 3x 31 32 */ \ 2420 { x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2421 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2422 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2423 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2424 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2425 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2426 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2427 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ | 2357 guarantee(fc->next() == NULL || fc->next()->prev() == fc, "Broken list"); 2358 guarantee((fc->next() == NULL) == (fc == tail), "Incorrect tail"); 2359 } 2360 guarantee(n == num, "Incorrect count"); 2361 } 2362 2363 #ifndef PRODUCT 2364 void CompactibleFreeListSpace::check_free_list_consistency() const { 2365 assert((TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >::min_size() <= IndexSetSize), 2366 "Some sizes can't be allocated without recourse to" 2367 " linear allocation buffers"); 2368 assert((TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >::min_size()*HeapWordSize == sizeof(TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >)), 2369 "else MIN_TREE_CHUNK_SIZE is wrong"); 2370 assert(IndexSetStart != 0, "IndexSetStart not initialized"); 2371 assert(IndexSetStride != 0, "IndexSetStride not initialized"); 2372 } 2373 #endif 2374 2375 void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { 2376 assert_lock_strong(&_freelistLock); 2377 LogTarget(Debug, gc, freelist, census) log; 2378 if (!log.is_enabled()) { 2379 return; 2380 } 2381 AdaptiveFreeList<FreeChunk> total; 2382 log.print("end sweep# " SIZE_FORMAT, sweep_count); 2383 ResourceMark rm; 2384 outputStream* out = log.stream(); 2385 AdaptiveFreeList<FreeChunk>::print_labels_on(out, "size"); 2386 size_t total_free = 0; 2387 for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { 2388 const AdaptiveFreeList<FreeChunk> *fl = &_indexedFreeList[i]; 2389 total_free += fl->count() * fl->size(); 2390 if (i % (40*IndexSetStride) == 0) { 2391 AdaptiveFreeList<FreeChunk>::print_labels_on(out, "size"); 2392 } 2393 fl->print_on(out); 2394 total.set_bfr_surp( total.bfr_surp() + fl->bfr_surp() ); 2395 total.set_surplus( total.surplus() + fl->surplus() ); 2396 total.set_desired( total.desired() + fl->desired() ); 2397 total.set_prev_sweep( total.prev_sweep() + fl->prev_sweep() ); 2398 total.set_before_sweep(total.before_sweep() + fl->before_sweep()); 2399 total.set_count( total.count() + fl->count() ); 2400 total.set_coal_births( total.coal_births() + fl->coal_births() ); 2401 total.set_coal_deaths( total.coal_deaths() + fl->coal_deaths() ); 2402 total.set_split_births(total.split_births() + fl->split_births()); 2403 total.set_split_deaths(total.split_deaths() + fl->split_deaths()); 2404 } 2405 total.print_on(out, "TOTAL"); 2406 log.print("Total free in indexed lists " SIZE_FORMAT " words", total_free); 2407 log.print("growth: %8.5f deficit: %8.5f", 2408 (double)(total.split_births()+total.coal_births()-total.split_deaths()-total.coal_deaths())/ 2409 (total.prev_sweep() != 0 ? (double)total.prev_sweep() : 1.0), 2410 (double)(total.desired() - total.count())/(total.desired() != 0 ? (double)total.desired() : 1.0)); 2411 _dictionary->print_dict_census(out); 2412 } 2413 2414 /////////////////////////////////////////////////////////////////////////// 2415 // CompactibleFreeListSpaceLAB 2416 /////////////////////////////////////////////////////////////////////////// 2417 2418 #define VECTOR_257(x) \ 2419 /* 1 2 3 4 5 6 7 8 9 1x 11 12 13 14 15 16 17 18 19 2x 21 22 23 24 25 26 27 28 29 3x 31 32 */ \ 2420 { x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2421 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2422 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2423 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2424 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2425 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2426 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ 2427 x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ |