# HG changeset patch # User jprovino # Date 1434659284 14400 # Node ID 9280d10f1f267a0a4a5838d2966e49eca0102801 # Parent 21f527ce09e0ef72ea59b0430550e6207ef8bc26 8085987: Vm crash "not long aligned" in nsk/stress/metaspace/jck60/jck6* tests Summary: The word size being allocated needs to be rounded up. Reviewed-by: jmasa, tbenson diff -r 21f527ce09e0 -r 9280d10f1f26 hotspot/src/share/vm/memory/metaspace.cpp --- a/hotspot/src/share/vm/memory/metaspace.cpp Fri Jun 19 13:03:58 2015 +0000 +++ b/hotspot/src/share/vm/memory/metaspace.cpp Thu Jun 18 16:28:04 2015 -0400 @@ -2423,7 +2423,9 @@ * 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()) { + size_t raw_word_size = get_raw_word_size(word_size); + + if (raw_word_size + Metachunk::overhead() > small_chunk_size()) { return NULL; } @@ -2438,9 +2440,9 @@ // 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); + mem = chunk->allocate(raw_word_size); + + inc_used_metrics(raw_word_size); // Track metaspace memory usage statistic. track_metaspace_memory_usage();