comparison src/share/vm/memory/metaspace.cpp @ 8007:d9058e388631

8007257: NPG: metaspace.cpp: Incorrect arguments in calls to err_msg Summary: Fix size checks in assert and corrected some print formats. Also reviewed by vitalyd@gmail.com. Reviewed-by: coleenp, sspitsyn
author mikael
date Fri, 01 Feb 2013 17:21:53 -0800
parents 1de1b145f6bc
children a83cd101fd62
comparison
equal deleted inserted replaced
8006:4700e77d44c1 8007:d9058e388631
1735 default: 1735 default:
1736 *chunk_word_size = SmallChunk; 1736 *chunk_word_size = SmallChunk;
1737 *class_chunk_word_size = ClassSmallChunk; 1737 *class_chunk_word_size = ClassSmallChunk;
1738 break; 1738 break;
1739 } 1739 }
1740 assert(chunk_word_size != 0 && class_chunk_word_size != 0, 1740 assert(*chunk_word_size != 0 && *class_chunk_word_size != 0,
1741 err_msg("Initial chunks sizes bad: data " SIZE_FORMAT 1741 err_msg("Initial chunks sizes bad: data " SIZE_FORMAT
1742 " class " SIZE_FORMAT, 1742 " class " SIZE_FORMAT,
1743 chunk_word_size, class_chunk_word_size)); 1743 *chunk_word_size, *class_chunk_word_size));
1744 } 1744 }
1745 1745
1746 size_t SpaceManager::sum_free_in_chunks_in_use() const { 1746 size_t SpaceManager::sum_free_in_chunks_in_use() const {
1747 MutexLockerEx cl(lock(), Mutex::_no_safepoint_check_flag); 1747 MutexLockerEx cl(lock(), Mutex::_no_safepoint_check_flag);
1748 size_t free = 0; 1748 size_t free = 0;
2038 } 2038 }
2039 assert(humongous_chunks->word_size() == (size_t) 2039 assert(humongous_chunks->word_size() == (size_t)
2040 align_size_up(humongous_chunks->word_size(), 2040 align_size_up(humongous_chunks->word_size(),
2041 HumongousChunkGranularity), 2041 HumongousChunkGranularity),
2042 err_msg("Humongous chunk size is wrong: word size " SIZE_FORMAT 2042 err_msg("Humongous chunk size is wrong: word size " SIZE_FORMAT
2043 " granularity " SIZE_FORMAT, 2043 " granularity %d",
2044 humongous_chunks->word_size(), HumongousChunkGranularity)); 2044 humongous_chunks->word_size(), HumongousChunkGranularity));
2045 Metachunk* next_humongous_chunks = humongous_chunks->next(); 2045 Metachunk* next_humongous_chunks = humongous_chunks->next();
2046 chunk_manager->humongous_dictionary()->return_chunk(humongous_chunks); 2046 chunk_manager->humongous_dictionary()->return_chunk(humongous_chunks);
2047 humongous_chunks = next_humongous_chunks; 2047 humongous_chunks = next_humongous_chunks;
2048 } 2048 }
2262 allocation_total(), 2262 allocation_total(),
2263 sum_used_in_chunks_in_use()); 2263 sum_used_in_chunks_in_use());
2264 } 2264 }
2265 MutexLockerEx cl(lock(), Mutex::_no_safepoint_check_flag); 2265 MutexLockerEx cl(lock(), Mutex::_no_safepoint_check_flag);
2266 assert(allocation_total() == sum_used_in_chunks_in_use(), 2266 assert(allocation_total() == sum_used_in_chunks_in_use(),
2267 err_msg("allocation total is not consistent %d vs %d", 2267 err_msg("allocation total is not consistent " SIZE_FORMAT
2268 " vs " SIZE_FORMAT,
2268 allocation_total(), sum_used_in_chunks_in_use())); 2269 allocation_total(), sum_used_in_chunks_in_use()));
2269 } 2270 }
2270 2271
2271 #endif 2272 #endif
2272 2273
2576 // For UseCompressedKlassPointers the class space is reserved as a piece of the 2577 // For UseCompressedKlassPointers the class space is reserved as a piece of the
2577 // Java heap because the compression algorithm is the same for each. The 2578 // Java heap because the compression algorithm is the same for each. The
2578 // argument passed in is at the top of the compressed space 2579 // argument passed in is at the top of the compressed space
2579 void Metaspace::initialize_class_space(ReservedSpace rs) { 2580 void Metaspace::initialize_class_space(ReservedSpace rs) {
2580 // The reserved space size may be bigger because of alignment, esp with UseLargePages 2581 // The reserved space size may be bigger because of alignment, esp with UseLargePages
2581 assert(rs.size() >= ClassMetaspaceSize, err_msg("%d != %d", rs.size(), ClassMetaspaceSize)); 2582 assert(rs.size() >= ClassMetaspaceSize,
2583 err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), ClassMetaspaceSize));
2582 _class_space_list = new VirtualSpaceList(rs); 2584 _class_space_list = new VirtualSpaceList(rs);
2583 } 2585 }
2584 2586
2585 void Metaspace::initialize(Mutex* lock, 2587 void Metaspace::initialize(Mutex* lock,
2586 MetaspaceType type) { 2588 MetaspaceType type) {