1.1 --- a/src/share/vm/runtime/handles.cpp Thu Oct 18 13:09:47 2012 -0400 1.2 +++ b/src/share/vm/runtime/handles.cpp Fri Oct 19 21:40:07 2012 -0400 1.3 @@ -158,13 +158,18 @@ 1.4 1.5 // Delete later chunks 1.6 if( _chunk->next() ) { 1.7 + // reset arena size before delete chunks. Otherwise, the total 1.8 + // arena size could exceed total chunk size 1.9 + assert(area->size_in_bytes() > size_in_bytes(), "Sanity check"); 1.10 + area->set_size_in_bytes(size_in_bytes()); 1.11 _chunk->next_chop(); 1.12 + } else { 1.13 + assert(area->size_in_bytes() == size_in_bytes(), "Sanity check"); 1.14 } 1.15 // Roll back arena to saved top markers 1.16 area->_chunk = _chunk; 1.17 area->_hwm = _hwm; 1.18 area->_max = _max; 1.19 - area->set_size_in_bytes(_size_in_bytes); 1.20 #ifdef ASSERT 1.21 // clear out first chunk (to detect allocation bugs) 1.22 if (ZapVMHandleArea) {