Request for Review (XS) - 8149643: Remove check of counters in VirtualSpaceNode::inc_container_count

Jon Masamitsu jon.masamitsu at
Thu Feb 11 17:56:22 UTC 2016

As part of managing Metaspaces a running count of the
number of Metachunks in a virtual-space is maintained.
The count is incremented as chunks are allocated from the
virtual-space.  The count can be verified by walking over
all the Metachunks in the virtual space.  This change
removes the verification code which was called each time
the running count was incremented.  The verification is
costly and no longer worth doing at each increment.  It is
still verified when the virtual-space is being retired.

Contributed by: dmitry.dmitriev at

The change is the deletion of 1 line.

--- a/src/share/vm/memory/metaspace.cpp

+++ b/src/share/vm/memory/metaspace.cpp

@@ -791,7 +791,6 @@

  void VirtualSpaceNode::inc_container_count() {



-  DEBUG_ONLY(verify_container_count();)


Testing with some specjvm benchmarks.



More information about the hotspot-gc-dev mailing list