--- old/test/java/lang/management/MemoryMXBean/MemoryTest.java 2012-09-05 09:58:46.309313470 +0200 +++ new/test/java/lang/management/MemoryMXBean/MemoryTest.java 2012-09-05 09:58:46.105313952 +0200 @@ -80,6 +80,7 @@ private static void checkMemoryPools() throws Exception { List pools = ManagementFactory.getMemoryPoolMXBeans(); + boolean hasPerm = false; int[] numPools = new int[NUM_TYPES]; for (ListIterator iter = pools.listIterator(); iter.hasNext();) { @@ -90,6 +91,15 @@ if (pool.getType() == MemoryType.NON_HEAP) { numPools[NONHEAP]++; } + if (pool.getName().toLowerCase().contains("perm")) { + hasPerm = true; + } + } + + if (!hasPerm) { + // If the VM does not have a perm gen there will be only one non heap pool + expectedMinNumPools[NONHEAP] = 1; + expectedMaxNumPools[NONHEAP] = 1; } // Check the number of Memory pools