-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
8, 9
To reproduce this bug compile the following program:
----- MetaspaceSizeTest.java ---
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryPoolMXBean;
import java.lang.management.MemoryUsage;
import java.util.List;
public class MetaspaceSizeTest {
public static void main(String args[]) {
MemoryPoolMXBean pool = getMemoryPool("Metaspace");
MemoryUsage mu = pool.getUsage();
System.out.println(mu);
}
private static MemoryPoolMXBean getMemoryPool(String name) {
List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
for (MemoryPoolMXBean pool : pools) {
if (pool.getName().equals(name)) {
return pool;
}
}
throw new RuntimeException("Expected to find a memory pool with name " + name);
}
}
----------------
and run it as shown bellow:
# for x in 2m 3m ; do for y in 2m 3m 4m ; do echo "size: $x max: $y" ;java -XX:MetaspaceSize=$x -XX:MaxMetaspaceSize=$y MetaspaceSizeTest ; done ; done;
You will see:
size: 2m max: 2m
Exception in thread "main" java.lang.InternalError: Memory Pool not found
at sun.management.MemoryPoolImpl.getUsage0(Native Method)
at sun.management.MemoryPoolImpl.getUsage(MemoryPoolImpl.java:96)
at MetaspaceSizeTest.main(MetaspaceSizeTest.java:11)
size: 2m max: 3m
Exception in thread "main" java.lang.InternalError: Memory Pool not found
at sun.management.MemoryPoolImpl.getUsage0(Native Method)
at sun.management.MemoryPoolImpl.getUsage(MemoryPoolImpl.java:96)
at MetaspaceSizeTest.main(MetaspaceSizeTest.java:11)
size: 2m max: 4m
init = 2252800(2200K) used = 2069648(2021K) committed = 2265088(2212K) max = 4194304(4096K)
size: 3m max: 2m
Exception in thread "main" java.lang.InternalError: Memory Pool not found
at sun.management.MemoryPoolImpl.getUsage0(Native Method)
at sun.management.MemoryPoolImpl.getUsage(MemoryPoolImpl.java:96)
at MetaspaceSizeTest.main(MetaspaceSizeTest.java:11)
size: 3m max: 3m
Exception in thread "main" java.lang.InternalError: Memory Pool not found
at sun.management.MemoryPoolImpl.getUsage0(Native Method)
at sun.management.MemoryPoolImpl.getUsage(MemoryPoolImpl.java:96)
at MetaspaceSizeTest.main(MetaspaceSizeTest.java:11)
size: 3m max: 4m
init = 2252800(2200K) used = 2069648(2021K) committed = 2265088(2212K) max = 4194304(4096K)
===
# java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b107)
Java HotSpot(TM) Client VM (build 25.0-b49, mixed mode)
- duplicates
-
JDK-8024323 In test gc/metaspace/TestMetaspaceMemoryPool.java, Exception: java.lang.InternalError: Memory Pool not found
- Closed
-
JDK-7196801 NPG: Fix java/lang/management/MemoryMXBean/LowMemoryTest2
- Closed
- is blocked by
-
JDK-8024547 MaxMetaspaceSize should limit the committed memory used by the metaspaces
- Closed
- relates to
-
JDK-8154458 serviceability/tmtools/jstat/GcCauseTest02 fails with InternalError: Memory Pool not found
- Closed
-
JDK-8024323 In test gc/metaspace/TestMetaspaceMemoryPool.java, Exception: java.lang.InternalError: Memory Pool not found
- Closed
-
JDK-8154458 serviceability/tmtools/jstat/GcCauseTest02 fails with InternalError: Memory Pool not found
- Closed
-
JDK-7041183 Improve error handling in src/share/vm/services/management.cpp
- Closed