8025550: valgrind: Conditional jump depends on uninitialised value in Arena::set_size_in_bytes()
Summary: Fixed initialized variable that could miscount arena memory
Reviewed-by: coleenp, ccheung
--- a/hotspot/src/share/vm/memory/allocation.cpp Sat Mar 15 04:03:42 2014 -0700
+++ b/hotspot/src/share/vm/memory/allocation.cpp Mon Mar 17 13:39:17 2014 -0400
@@ -446,6 +446,7 @@
_first = _chunk = new (AllocFailStrategy::EXIT_OOM, init_size) Chunk(init_size);
_hwm = _chunk->bottom(); // Save the cached hwm, max
_max = _chunk->top();
+ _size_in_bytes = 0;
set_size_in_bytes(init_size);
NOT_PRODUCT(Atomic::inc(&_instance_count);)
}
@@ -454,6 +455,7 @@
_first = _chunk = new (AllocFailStrategy::EXIT_OOM, Chunk::init_size) Chunk(Chunk::init_size);
_hwm = _chunk->bottom(); // Save the cached hwm, max
_max = _chunk->top();
+ _size_in_bytes = 0;
set_size_in_bytes(Chunk::init_size);
NOT_PRODUCT(Atomic::inc(&_instance_count);)
}