changeset 4336:1c88b99a2b01

8009282: Assertion "assert(used_and_free == capacity_bytes) failed: Accounting is wrong" failed with -XX:+Verbose -XX:+TraceMetadataChunkAllocation Summary: Assertion is only valid when at a safepoint, adjust accordingly. Reviewed-by: stefank, jmasa, tamao
author mgerdin
date Tue, 12 Mar 2013 09:42:24 +0100
parents 71f619500f9b
children ca9580859cf4
files src/share/vm/memory/metaspace.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/memory/metaspace.cpp	Mon Mar 11 15:37:10 2013 +0100
+++ b/src/share/vm/memory/metaspace.cpp	Tue Mar 12 09:42:24 2013 +0100
@@ -2440,7 +2440,8 @@
              free_chunks_capacity_bytes / K,
              used_and_free / K,
              capacity_bytes / K);
-  assert(used_and_free == capacity_bytes, "Accounting is wrong");
+  // Accounting can only be correct if we got the values during a safepoint
+  assert(!SafepointSynchronize::is_at_safepoint() || used_and_free == capacity_bytes, "Accounting is wrong");
 }
 
 // Print total fragmentation for class and data metaspaces separately