diff --git a/hotspot/test/TEST.ROOT b/hotspot/test/TEST.ROOT index e646c1aa08d1f949d2027c8c753025b9195459c8..6bf9e9a90097f63f8cb8e31d029605b63c938254 100644 --- a/hotspot/test/TEST.ROOT +++ b/hotspot/test/TEST.ROOT @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,6 @@ # It also contains test-suite configuration information. # The list of keywords supported in this test suite -keys=cte_test jcmd nmt regression gc +keys=cte_test jcmd nmt regression gc stress groups=TEST.groups [closed/TEST.groups] diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index f8846fe70cca5c6b3abed03908436f23f9e4e4c2..e4f1ee32d29bebc32f82dc6c4a8dda55bf782011 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -70,21 +70,29 @@ needs_jdk = \ runtime/7194254/Test7194254.java \ runtime/Metaspace/FragmentMetaspace.java \ runtime/NMT/BaselineWithParameter.java \ + runtime/NMT/JcmdBaselineDetail.java \ + runtime/NMT/JcmdDetailDiff.java \ + runtime/NMT/JcmdScaleDetail.java \ runtime/NMT/JcmdScale.java \ + runtime/NMT/JcmdSummaryDiff.java \ runtime/NMT/JcmdWithNMTDisabled.java \ + runtime/NMT/MallocRoundingReportTest.java \ + runtime/NMT/MallocSiteHashOverflow.java \ + runtime/NMT/MallocStressTest.java \ runtime/NMT/MallocTestType.java \ runtime/NMT/ReleaseCommittedMemory.java \ + runtime/NMT/ReleaseNoCommit.java \ runtime/NMT/ShutdownTwice.java \ runtime/NMT/SummaryAfterShutdown.java \ runtime/NMT/SummarySanityCheck.java \ runtime/NMT/ThreadedMallocTestType.java \ runtime/NMT/ThreadedVirtualAllocTestType.java \ + runtime/NMT/VirtualAllocCommitUncommitRecommit.java \ runtime/NMT/VirtualAllocTestType.java \ runtime/RedefineObject/TestRedefineObject.java \ runtime/Thread/TestThreadDumpMonitorContention.java \ runtime/XCheckJniJsig/XCheckJSig.java \ serviceability/attach/AttachWithStalePidFile.java \ - serviceability/jvmti/8036666/GetObjectLockCount.java \ serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \ serviceability/dcmd/DynLibDcmdTest.java @@ -120,16 +128,12 @@ needs_compact3 = \ gc/6581734/Test6581734.java \ gc/7072527/TestFullGCCount.java \ gc/g1/TestHumongousAllocInitialMark.java \ - gc/g1/TestHumongousShrinkHeap.java \ gc/arguments/TestG1HeapRegionSize.java \ gc/metaspace/TestMetaspaceMemoryPool.java \ gc/arguments/TestDynMinHeapFreeRatio.java \ gc/arguments/TestDynMaxHeapFreeRatio.java \ - gc/parallelScavenge/TestDynShrinkHeap.java \ runtime/InternalApi/ThreadCpuTimesDeadlock.java \ serviceability/threads/TestFalseDeadLock.java \ - serviceability/jvmti/GetObjectSizeOverflow.java \ - serviceability/jvmti/TestRedefineWithUnresolvedClass.java # Compact 2 adds full VM tests compact2 = \ diff --git a/hotspot/test/runtime/NMT/BaselineWithParameter.java b/hotspot/test/runtime/NMT/BaselineWithParameter.java index ff10b28a0601fe33e61ba52f27ce4c7df8e74d9f..ef34a11a41640edb1a317208da1a2409c248065c 100644 --- a/hotspot/test/runtime/NMT/BaselineWithParameter.java +++ b/hotspot/test/runtime/NMT/BaselineWithParameter.java @@ -27,6 +27,7 @@ * @key nmt jcmd regression * @summary Regression test for invoking a jcmd with baseline=false, result was that the target VM crashed * @library /testlibrary + * @ignore * @run main/othervm -XX:NativeMemoryTracking=detail BaselineWithParameter */ diff --git a/hotspot/test/runtime/NMT/CommandLineDetail.java b/hotspot/test/runtime/NMT/CommandLineDetail.java index 01b0d0d3faeac3c72a06fc240705af43b009ac86..b3ff104207fdb2cdd764fc67250c1569c3a99475 100644 --- a/hotspot/test/runtime/NMT/CommandLineDetail.java +++ b/hotspot/test/runtime/NMT/CommandLineDetail.java @@ -26,6 +26,7 @@ * @key nmt * @summary Running with NMT detail should not result in an error * @library /testlibrary + * @ignore */ import com.oracle.java.testlibrary.*; diff --git a/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java b/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java index 956cdd260067fe38995010fd9b42cdd86fa92f8c..1c05a195d447ce5ebf68b44e2009bdd2fee0911d 100644 --- a/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java +++ b/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java @@ -26,6 +26,7 @@ * @key nmt * @summary Empty argument to NMT should result in an informative error message * @library /testlibrary + * @ignore */ import com.oracle.java.testlibrary.*; diff --git a/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java b/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java index 79cc2de94422aeddc259e9f74ac4304bf3281a7d..6cc451023976e78856eafcba73563fc41d0486ca 100644 --- a/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java +++ b/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java @@ -26,6 +26,7 @@ * @key nmt * @summary Invalid argument to NMT should result in an informative error message * @library /testlibrary + * @ignore */ import com.oracle.java.testlibrary.*; diff --git a/hotspot/test/runtime/NMT/CommandLineSummary.java b/hotspot/test/runtime/NMT/CommandLineSummary.java index d07bc7eae634349b23634107cc7295982d644314..bef1ab9cb381c5b846e91db225c93580cedbd181 100644 --- a/hotspot/test/runtime/NMT/CommandLineSummary.java +++ b/hotspot/test/runtime/NMT/CommandLineSummary.java @@ -26,6 +26,7 @@ * @key nmt * @summary Running with NMT summary should not result in an error * @library /testlibrary + * @ignore */ import com.oracle.java.testlibrary.*; diff --git a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java index 4193c9775d439a0ad177debd43f3ae0602686300..a33e2ca4aa3a4e48a3d23f6ecdb29d8374106f03 100644 --- a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java +++ b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java @@ -26,6 +26,7 @@ * @key nmt * @summary Turning off NMT should not result in an error * @library /testlibrary + * @ignore */ import com.oracle.java.testlibrary.*; diff --git a/hotspot/test/runtime/NMT/JcmdScale.java b/hotspot/test/runtime/NMT/JcmdScale.java index e57d27b59a3cd5e246c354fdffcae7a06015d5c8..42b7393df62f930c27e907db3b7ba0be1edd4c64 100644 --- a/hotspot/test/runtime/NMT/JcmdScale.java +++ b/hotspot/test/runtime/NMT/JcmdScale.java @@ -26,6 +26,7 @@ * @key nmt jcmd * @summary Test the NMT scale parameter * @library /testlibrary + * @ignore * @run main/othervm -XX:NativeMemoryTracking=summary JcmdScale */ @@ -41,15 +42,15 @@ public class JcmdScale { pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=KB"}); output = new OutputAnalyzer(pb.start()); - output.shouldContain("KB, committed="); + output.shouldContain("KB, committed="); pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=MB"}); output = new OutputAnalyzer(pb.start()); - output.shouldContain("MB, committed="); + output.shouldContain("MB, committed="); pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=GB"}); output = new OutputAnalyzer(pb.start()); - output.shouldContain("GB, committed="); + output.shouldContain("GB, committed="); pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=apa"}); output = new OutputAnalyzer(pb.start()); @@ -57,7 +58,7 @@ public class JcmdScale { pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary", "scale=GB"}); output = new OutputAnalyzer(pb.start()); - output.shouldContain("GB, committed="); + output.shouldContain("GB, committed="); pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary", "scale=apa"}); output = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java b/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java index 9ef37434937e15e1cce8e5edf3ce3f589a3c5922..086038eb233299b46dbeab7a6b2eb4a52e90c207 100644 --- a/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java +++ b/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java @@ -26,6 +26,7 @@ * @key nmt jcmd * @summary Verify that jcmd correctly reports that NMT is not enabled * @library /testlibrary + * @ignore * @run main JcmdWithNMTDisabled 1 */ diff --git a/hotspot/test/runtime/NMT/MallocTestType.java b/hotspot/test/runtime/NMT/MallocTestType.java index 8a39af790e480e9793c3ace39486817675982c42..444dfda646f3b191bc701abf98429fa7f2c40e70 100644 --- a/hotspot/test/runtime/NMT/MallocTestType.java +++ b/hotspot/test/runtime/NMT/MallocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @key nmt jcmd * @library /testlibrary /testlibrary/whitebox * @build MallocTestType + * @ignore * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTestType */ @@ -51,11 +52,6 @@ public class MallocTestType { long memAlloc1 = wb.NMTMalloc(512 * 1024); wb.NMTFree(memAlloc2); - // Use WB API to ensure that all data has been merged before we continue - if (!wb.NMTWaitForDataMerge()) { - throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); - } - // Run 'jcmd VM.native_memory summary' pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); output = new OutputAnalyzer(pb.start()); @@ -64,10 +60,6 @@ public class MallocTestType { // Free the memory allocated by NMTAllocTest wb.NMTFree(memAlloc1); - // Use WB API to ensure that all data has been merged before we continue - if (!wb.NMTWaitForDataMerge()) { - throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); - } output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Test (reserved="); } diff --git a/hotspot/test/runtime/NMT/PrintNMTStatistics.java b/hotspot/test/runtime/NMT/PrintNMTStatistics.java index 534fe7ae421d9b469d0e7b89d0aab35c34130443..a09007b366d27c0aac791f5c60274723dedd417c 100644 --- a/hotspot/test/runtime/NMT/PrintNMTStatistics.java +++ b/hotspot/test/runtime/NMT/PrintNMTStatistics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ * @summary Make sure PrintNMTStatistics works on normal JVM exit * @library /testlibrary /testlibrary/whitebox * @build PrintNMTStatistics + * @ignore * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main PrintNMTStatistics */ @@ -45,10 +46,6 @@ public class PrintNMTStatistics { // We start a new java process running with an argument and use WB API to ensure // we have data for NMT on VM exit if (args.length > 0) { - // Use WB API to ensure that all data has been merged before we continue - if (!WhiteBox.getWhiteBox().NMTWaitForDataMerge()) { - throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); - } return; } diff --git a/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java b/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java index 1c25f284d4b043f19855d1964951ec0a61b8403d..cdc3ded942aa58149859c12e48fc1278b26b1a95 100644 --- a/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java +++ b/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java @@ -26,6 +26,7 @@ * @key nmt * @summary Trying to enable PrintNMTStatistics should result in a warning * @library /testlibrary + * @ignore */ import com.oracle.java.testlibrary.*; diff --git a/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java b/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java index 66bc3b1896909d70538b97d8be33d3091eb693f8..1f8592a36053d04208e44317033ced7b9236a651 100644 --- a/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java +++ b/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ * @key nmt regression * @library /testlibrary /testlibrary/whitebox * @build ReleaseCommittedMemory + * @ignore * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ReleaseCommittedMemory */ @@ -44,7 +45,6 @@ public class ReleaseCommittedMemory { addr = wb.NMTReserveMemory(reserveSize); wb.NMTCommitMemory(addr, 128*1024); wb.NMTReleaseMemory(addr, reserveSize); - wb.NMTWaitForDataMerge(); } } diff --git a/hotspot/test/runtime/NMT/ShutdownTwice.java b/hotspot/test/runtime/NMT/ShutdownTwice.java index 1bb327aedb11504a69f5acf2ebe51f5e3a118dfe..d6dcf8013e95c1293f12a2bfbe91dabc49dc8ea8 100644 --- a/hotspot/test/runtime/NMT/ShutdownTwice.java +++ b/hotspot/test/runtime/NMT/ShutdownTwice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @key nmt jcmd * @summary Run shutdown twice * @library /testlibrary + * @ignore * @run main/othervm -XX:NativeMemoryTracking=detail ShutdownTwice */ @@ -45,12 +46,12 @@ public class ShutdownTwice { output = new OutputAnalyzer(pb.start()); // Verify that jcmd reports that NMT is shutting down - output.shouldContain("Shutdown is in progress, it will take a few moments to completely shutdown"); + output.shouldContain("Native memory tracking has been turned off"); // Run shutdown again output = new OutputAnalyzer(pb.start()); // Verify that jcmd reports that NMT has been shutdown already - output.shouldContain("Native memory tracking has been shutdown by user"); + output.shouldContain("Native memory tracking has been shutdown"); } } diff --git a/hotspot/test/runtime/NMT/SummaryAfterShutdown.java b/hotspot/test/runtime/NMT/SummaryAfterShutdown.java index 96061f3f0049d786211da27e3e26cc2fb91462d8..1baa484aa25cb2726e4621f18800d1a08c222ed6 100644 --- a/hotspot/test/runtime/NMT/SummaryAfterShutdown.java +++ b/hotspot/test/runtime/NMT/SummaryAfterShutdown.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @key nmt jcmd * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown * @library /testlibrary + * @ignore * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown */ @@ -44,13 +45,13 @@ public class SummaryAfterShutdown { output = new OutputAnalyzer(pb.start()); // Verify that jcmd reports that NMT is shutting down - output.shouldContain("Shutdown is in progress, it will take a few moments to completely shutdown"); + output.shouldContain("Native memory tracking has been turned off"); // Run 'jcmd VM.native_memory summary' pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); output = new OutputAnalyzer(pb.start()); // Verify that jcmd reports that NMT has been shutdown - output.shouldContain("Native memory tracking has been shutdown by user"); + output.shouldContain("Native memory tracking has been shutdown"); } } diff --git a/hotspot/test/runtime/NMT/SummarySanityCheck.java b/hotspot/test/runtime/NMT/SummarySanityCheck.java index 221ad9365e5b3fde92fb12c1c6b60ec4fde7e385..1f37e4707497fb17c4576719906d1b5fdf0f340b 100644 --- a/hotspot/test/runtime/NMT/SummarySanityCheck.java +++ b/hotspot/test/runtime/NMT/SummarySanityCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary Sanity check the output of NMT * @library /testlibrary /testlibrary/whitebox * @build SummarySanityCheck + * @ignore * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck */ @@ -44,11 +45,6 @@ public class SummarySanityCheck { // Grab my own PID String pid = Integer.toString(ProcessTools.getProcessId()); - // Use WB API to ensure that all data has been merged before we continue - if (!WhiteBox.getWhiteBox().NMTWaitForDataMerge()) { - throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); - } - ProcessBuilder pb = new ProcessBuilder(); // Run 'jcmd VM.native_memory summary scale=KB' @@ -69,13 +65,13 @@ public class SummarySanityCheck { // Match '- (reserved=KB, committed=KB) Pattern mtTypePattern = Pattern.compile("-\\s+(?[\\w\\s]+)\\(reserved=(?\\d+)KB,\\scommitted=(?\\d+)KB\\)"); // Match 'Total: reserved=KB, committed=KB' - Pattern totalMemoryPattern = Pattern.compile("Total\\:\\s\\sreserved=(?\\d+)KB,\\s\\scommitted=(?\\d+)KB"); + Pattern totalMemoryPattern = Pattern.compile("Total\\:\\sreserved=(?\\d+)KB,\\scommitted=(?\\d+)KB"); for (int i = 0; i < lines.length; i++) { if (lines[i].startsWith("Total")) { Matcher totalMemoryMatcher = totalMemoryPattern.matcher(lines[i]); - if (totalMemoryMatcher.matches() && totalMemoryMatcher.groupCount() == 2) { + if (totalMemoryMatcher.matches()) { totalCommitted = Integer.parseInt(totalMemoryMatcher.group("committed")); totalReserved = Integer.parseInt(totalMemoryMatcher.group("reserved")); } else { diff --git a/hotspot/test/runtime/NMT/ThreadedMallocTestType.java b/hotspot/test/runtime/NMT/ThreadedMallocTestType.java index eadb719d50d75ce98ac7e30ce75a1b0aebeaf83d..82d98c523b3a6059d05c227a1594c3c0fddd7c98 100644 --- a/hotspot/test/runtime/NMT/ThreadedMallocTestType.java +++ b/hotspot/test/runtime/NMT/ThreadedMallocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @key nmt jcmd * @library /testlibrary /testlibrary/whitebox * @build ThreadedMallocTestType + * @ignore * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType */ @@ -58,11 +59,6 @@ public class ThreadedMallocTestType { allocThread.start(); allocThread.join(); - // Use WB API to ensure that all data has been merged before we continue - if (!wb.NMTWaitForDataMerge()) { - throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); - } - // Run 'jcmd VM.native_memory summary' pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); output = new OutputAnalyzer(pb.start()); @@ -80,11 +76,6 @@ public class ThreadedMallocTestType { freeThread.start(); freeThread.join(); - // Use WB API to ensure that all data has been merged before we continue - if (!wb.NMTWaitForDataMerge()) { - throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); - } - output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Test (reserved="); } diff --git a/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java b/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java index 1a7b929f0d66eb73f0f3834dd19ddd2fa2d3c281..3f9ab7ce98d47a6f106e922c776acbf324c0cc16 100644 --- a/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java +++ b/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @key nmt jcmd * @library /testlibrary /testlibrary/whitebox * @build ThreadedVirtualAllocTestType + * @ignore * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedVirtualAllocTestType */ @@ -60,8 +61,6 @@ public class ThreadedVirtualAllocTestType { reserveThread.start(); reserveThread.join(); - mergeData(); - pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "detail"}); output = new OutputAnalyzer(pb.start()); output.shouldContain("Test (reserved=512KB, committed=0KB)"); @@ -77,8 +76,6 @@ public class ThreadedVirtualAllocTestType { commitThread.start(); commitThread.join(); - mergeData(); - output = new OutputAnalyzer(pb.start()); output.shouldContain("Test (reserved=512KB, committed=128KB)"); if (has_nmt_detail) { @@ -93,8 +90,6 @@ public class ThreadedVirtualAllocTestType { uncommitThread.start(); uncommitThread.join(); - mergeData(); - output = new OutputAnalyzer(pb.start()); output.shouldContain("Test (reserved=512KB, committed=0KB)"); output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed"); @@ -107,17 +102,9 @@ public class ThreadedVirtualAllocTestType { releaseThread.start(); releaseThread.join(); - mergeData(); - output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Test (reserved="); output.shouldNotContain("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved"); } - public static void mergeData() throws Exception { - // Use WB API to ensure that all data has been merged before we continue - if (!wb.NMTWaitForDataMerge()) { - throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); } - } -} diff --git a/hotspot/test/runtime/NMT/VirtualAllocTestType.java b/hotspot/test/runtime/NMT/VirtualAllocTestType.java index 86e751c6b312c19fe8194b3b9350f5aa2fc6e285..f69f5ba6d9b33c94893b4b2824a2c3397c16dbde 100644 --- a/hotspot/test/runtime/NMT/VirtualAllocTestType.java +++ b/hotspot/test/runtime/NMT/VirtualAllocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @summary Test Reserve/Commit/Uncommit/Release of virtual memory and that we track it correctly * @key nmt jcmd * @library /testlibrary /testlibrary/whitebox + * @ignore * @build VirtualAllocTestType * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocTestType @@ -54,7 +55,6 @@ public class VirtualAllocTestType { } addr = wb.NMTReserveMemory(reserveSize); - mergeData(); pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "detail"}); output = new OutputAnalyzer(pb.start()); @@ -65,7 +65,6 @@ public class VirtualAllocTestType { wb.NMTCommitMemory(addr, commitSize); - mergeData(); output = new OutputAnalyzer(pb.start()); output.shouldContain("Test (reserved=256KB, committed=128KB)"); @@ -75,24 +74,15 @@ public class VirtualAllocTestType { wb.NMTUncommitMemory(addr, commitSize); - mergeData(); output = new OutputAnalyzer(pb.start()); output.shouldContain("Test (reserved=256KB, committed=0KB)"); output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + commitSize) + "\\] committed"); wb.NMTReleaseMemory(addr, reserveSize); - mergeData(); output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Test (reserved="); output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*" + Long.toHexString(addr + reserveSize) + "\\] reserved"); } - - public static void mergeData() throws Exception { - // Use WB API to ensure that all data has been merged before we continue - if (!wb.NMTWaitForDataMerge()) { - throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); } - } -} diff --git a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java index 9bc28bf227f672e022a4a7c130348a60ee0d78f1..1e6ba32e2d08ab20d8d3e1545a6823cb3229a42f 100644 --- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java +++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java @@ -25,10 +25,6 @@ package sun.hotspot; import java.lang.reflect.Executable; -import java.util.Arrays; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Stream; import java.security.BasicPermission; import sun.hotspot.parser.DiagnosticCommand; @@ -134,7 +130,7 @@ public class WhiteBox { } public native int getCompileQueueSize(int compLevel); public native boolean testSetForceInlineMethod(Executable method, boolean value); - public boolean enqueueMethodForCompilation(Executable method, int compLevel) { + public boolean enqueueMethodForCompilation(Executable method, int compLevel) { return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/); } public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci); @@ -147,8 +143,6 @@ public class WhiteBox { // Memory public native void readReservedMemory(); - public native long allocateMetaspace(ClassLoader classLoader, long size); - public native void freeMetaspace(ClassLoader classLoader, long addr, long size); // force Full GC public native void fullGC(); @@ -157,34 +151,8 @@ public class WhiteBox { public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations); public native void runMemoryUnitTests(); public native void readFromNoaccessArea(); - public native long getThreadStackSize(); - public native long getThreadRemainingStackSize(); // CPU features public native String getCPUFeatures(); - // VM flags - public native void setBooleanVMFlag(String name, boolean value); - public native void setIntxVMFlag(String name, long value); - public native void setUintxVMFlag(String name, long value); - public native void setUint64VMFlag(String name, long value); - public native void setStringVMFlag(String name, String value); - public native void setDoubleVMFlag(String name, double value); - public native Boolean getBooleanVMFlag(String name); - public native Long getIntxVMFlag(String name); - public native Long getUintxVMFlag(String name); - public native Long getUint64VMFlag(String name); - public native String getStringVMFlag(String name); - public native Double getDoubleVMFlag(String name); - private final List> flagsGetters = Arrays.asList( - this::getBooleanVMFlag, this::getIntxVMFlag, this::getUintxVMFlag, - this::getUint64VMFlag, this::getStringVMFlag, this::getDoubleVMFlag); - - public Object getVMFlag(String name) { - return flagsGetters.stream() - .map(f -> f.apply(name)) - .filter(x -> x != null) - .findAny() - .orElse(null); - } }