diff -r 8ebcedb7604d -r 716c64bda5ba src/share/vm/runtime/handles.cpp --- a/src/share/vm/runtime/handles.cpp Thu Oct 18 13:09:47 2012 -0400 +++ b/src/share/vm/runtime/handles.cpp Fri Oct 19 21:40:07 2012 -0400 @@ -158,13 +158,18 @@ // Delete later chunks if( _chunk->next() ) { + // reset arena size before delete chunks. Otherwise, the total + // arena size could exceed total chunk size + assert(area->size_in_bytes() > size_in_bytes(), "Sanity check"); + area->set_size_in_bytes(size_in_bytes()); _chunk->next_chop(); + } else { + assert(area->size_in_bytes() == size_in_bytes(), "Sanity check"); } // Roll back arena to saved top markers area->_chunk = _chunk; area->_hwm = _hwm; area->_max = _max; - area->set_size_in_bytes(_size_in_bytes); #ifdef ASSERT // clear out first chunk (to detect allocation bugs) if (ZapVMHandleArea) {