src/share/vm/memory/metaspace.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/memory/metaspace.cpp

src/share/vm/memory/metaspace.cpp

Print this page

        

*** 2421,2431 **** * available and OOME would be thrown. Instead of doing that, * if the allocation request size fits in a small chunk, an attempt * will be made to allocate a small chunk. */ MetaWord* SpaceManager::get_small_chunk_and_allocate(size_t word_size) { ! if (word_size + Metachunk::overhead() > small_chunk_size()) { return NULL; } MutexLockerEx cl(lock(), Mutex::_no_safepoint_check_flag); MutexLockerEx cl1(expand_lock(), Mutex::_no_safepoint_check_flag); --- 2421,2433 ---- * available and OOME would be thrown. Instead of doing that, * if the allocation request size fits in a small chunk, an attempt * will be made to allocate a small chunk. */ MetaWord* SpaceManager::get_small_chunk_and_allocate(size_t word_size) { ! size_t raw_word_size = get_raw_word_size(word_size); ! ! if (raw_word_size + Metachunk::overhead() > small_chunk_size()) { return NULL; } MutexLockerEx cl(lock(), Mutex::_no_safepoint_check_flag); MutexLockerEx cl1(expand_lock(), Mutex::_no_safepoint_check_flag);
*** 2436,2448 **** if (chunk != NULL) { // Add chunk to the in-use chunk list and do an allocation from it. // Add to this manager's list of chunks in use. add_chunk(chunk, false); ! mem = chunk->allocate(word_size); ! inc_used_metrics(word_size); // Track metaspace memory usage statistic. track_metaspace_memory_usage(); } --- 2438,2450 ---- if (chunk != NULL) { // Add chunk to the in-use chunk list and do an allocation from it. // Add to this manager's list of chunks in use. add_chunk(chunk, false); ! mem = chunk->allocate(raw_word_size); ! inc_used_metrics(raw_word_size); // Track metaspace memory usage statistic. track_metaspace_memory_usage(); }
src/share/vm/memory/metaspace.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File