comparison src/share/vm/memory/metaspace.cpp @ 12239:8227700da288

8024751: Fix bugs in TraceMetadata Reviewed-by: jmasa, brutisso
author stefank
date Fri, 13 Sep 2013 22:23:48 +0200
parents 335b388c4b28
children 8c5e6482cbfc
comparison
equal deleted inserted replaced
12238:9e11762cee52 12239:8227700da288
2364 2364
2365 Metachunk* next = vs_list()->get_new_chunk(word_size, 2365 Metachunk* next = vs_list()->get_new_chunk(word_size,
2366 grow_chunks_by_words, 2366 grow_chunks_by_words,
2367 medium_chunk_bunch()); 2367 medium_chunk_bunch());
2368 2368
2369 if (TraceMetadataHumongousAllocation && 2369 if (TraceMetadataHumongousAllocation && next != NULL &&
2370 SpaceManager::is_humongous(next->word_size())) { 2370 SpaceManager::is_humongous(next->word_size())) {
2371 gclog_or_tty->print_cr(" new humongous chunk word size " PTR_FORMAT, 2371 gclog_or_tty->print_cr(" new humongous chunk word size "
2372 next->word_size()); 2372 PTR_FORMAT, next->word_size());
2373 } 2373 }
2374 2374
2375 return next; 2375 return next;
2376 } 2376 }
2377 2377
2485 for (Metachunk* curr = chunks_in_use(index); 2485 for (Metachunk* curr = chunks_in_use(index);
2486 curr != NULL; 2486 curr != NULL;
2487 curr = curr->next()) { 2487 curr = curr->next()) {
2488 out->print("%d) ", i++); 2488 out->print("%d) ", i++);
2489 curr->print_on(out); 2489 curr->print_on(out);
2490 if (TraceMetadataChunkAllocation && Verbose) {
2491 block_freelists()->print_on(out);
2492 }
2493 curr_total += curr->word_size(); 2490 curr_total += curr->word_size();
2494 used += curr->used_word_size(); 2491 used += curr->used_word_size();
2495 capacity += curr->capacity_word_size(); 2492 capacity += curr->capacity_word_size();
2496 waste += curr->free_word_size() + curr->overhead();; 2493 waste += curr->free_word_size() + curr->overhead();;
2497 } 2494 }
2495 }
2496
2497 if (TraceMetadataChunkAllocation && Verbose) {
2498 block_freelists()->print_on(out);
2498 } 2499 }
2499 2500
2500 size_t free = current_chunk() == NULL ? 0 : current_chunk()->free_word_size(); 2501 size_t free = current_chunk() == NULL ? 0 : current_chunk()->free_word_size();
2501 // Free space isn't wasted. 2502 // Free space isn't wasted.
2502 waste -= free; 2503 waste -= free;