hotspot/src/share/vm/runtime/handles.cpp
changeset 14120 7d298141c258
parent 14078 2b2b8833c422
child 14583 d70ee55535f4
--- a/hotspot/src/share/vm/runtime/handles.cpp	Thu Oct 18 13:09:47 2012 -0400
+++ b/hotspot/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) {