InternalError: Memory Pool (Shenandoah) not found

Aleksey Shipilev shade at redhat.com
Sat Nov 3 22:29:18 UTC 2018


On 11/03/2018 09:53 PM, Aleksey Shipilev wrote:
> Reproduced. Weird bug. We actually have the test that is supposed to verify it:
> 
> http://hg.openjdk.java.net/shenandoah/jdk/file/4ce8c4c952b3/test/hotspot/jtreg/gc/shenandoah/TestMemoryMXBeans.java
> 
> But it passes! And I scanned through all integer-M heap sizes to find that -Xms4097m -Xmx4097m is
> the lowest heap settings where it fails. Let's see what is up.

I think it is the bug in Shenandoah management bindings somewhere. That Internal Error is actually a
masked exception from java.lang.management.MemoryUsage constructor that is called from within the
VM. But as VM calls it, the exception gets eaten up, and it appears as if the pool is not existent.

This seems to be the easiest way to intercept bad values before they got into the system:

diff -r 4ce8c4c952b3 src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp  Fri Nov 02 19:38:54 2018 +0100
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp  Sat Nov 03 23:28:28 2018 +0100
@@ -34,7 +34,9 @@
 MemoryUsage ShenandoahMemoryPool::get_memory_usage() {
   size_t maxSize   = max_size();
   size_t used      = used_in_bytes();
   size_t committed = _heap->committed();

+  assert (committed <= maxSize, "sanity, committed: " SIZE_FORMAT ", maxSize: " SIZE_FORMAT,
committed, maxSize);
+
   return MemoryUsage(initial_size(), used, committed, maxSize);
 }

Yields:

#  assert(committed <= maxSize) failed: sanity, committed: 4297064448, maxSize: 4294967296


-Aleksey



More information about the shenandoah-dev mailing list