< prev index next >

test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java

Print this page




  33 import sun.jvm.hotspot.HotSpotAgent;
  34 import sun.jvm.hotspot.debugger.*;
  35 
  36 import jdk.test.lib.apps.LingeredApp;
  37 import jdk.test.lib.JDKToolLauncher;
  38 import jdk.test.lib.JDKToolFinder;
  39 import jdk.test.lib.Platform;
  40 import jdk.test.lib.process.ProcessTools;
  41 import jdk.test.lib.process.OutputAnalyzer;
  42 import jdk.test.lib.Utils;
  43 import jdk.test.lib.Asserts;
  44 import jdk.test.lib.hprof.HprofParser;
  45 import jdk.test.lib.hprof.parser.HprofReader;
  46 import jdk.test.lib.hprof.parser.PositionDataInputStream;
  47 import jdk.test.lib.hprof.model.Snapshot;
  48 
  49 /**
  50  * @test
  51  * @library /test/lib
  52  * @requires vm.hasSAandCanAttach & os.family != "mac"
  53  * @requires vm.gc != "Z"
  54  * @modules java.base/jdk.internal.misc
  55  *          jdk.hotspot.agent/sun.jvm.hotspot
  56  *          jdk.hotspot.agent/sun.jvm.hotspot.utilities
  57  *          jdk.hotspot.agent/sun.jvm.hotspot.oops
  58  *          jdk.hotspot.agent/sun.jvm.hotspot.debugger
  59  * @run main/othervm TestHeapDumpForInvokeDynamic
  60  */
  61 
  62 public class TestHeapDumpForInvokeDynamic {
  63 
  64     private static LingeredAppWithInvokeDynamic theApp = null;
  65 
  66     private static void verifyHeapDump(String heapFile) {
  67 
  68         File heapDumpFile = new File(heapFile);
  69         Asserts.assertTrue(heapDumpFile.exists() && heapDumpFile.isFile(),
  70                           "Could not create dump file " + heapDumpFile.getAbsolutePath());
  71         try (PositionDataInputStream in = new PositionDataInputStream(
  72                 new BufferedInputStream(new FileInputStream(heapFile)))) {
  73             int i = in.readInt();




  33 import sun.jvm.hotspot.HotSpotAgent;
  34 import sun.jvm.hotspot.debugger.*;
  35 
  36 import jdk.test.lib.apps.LingeredApp;
  37 import jdk.test.lib.JDKToolLauncher;
  38 import jdk.test.lib.JDKToolFinder;
  39 import jdk.test.lib.Platform;
  40 import jdk.test.lib.process.ProcessTools;
  41 import jdk.test.lib.process.OutputAnalyzer;
  42 import jdk.test.lib.Utils;
  43 import jdk.test.lib.Asserts;
  44 import jdk.test.lib.hprof.HprofParser;
  45 import jdk.test.lib.hprof.parser.HprofReader;
  46 import jdk.test.lib.hprof.parser.PositionDataInputStream;
  47 import jdk.test.lib.hprof.model.Snapshot;
  48 
  49 /**
  50  * @test
  51  * @library /test/lib
  52  * @requires vm.hasSAandCanAttach & os.family != "mac"

  53  * @modules java.base/jdk.internal.misc
  54  *          jdk.hotspot.agent/sun.jvm.hotspot
  55  *          jdk.hotspot.agent/sun.jvm.hotspot.utilities
  56  *          jdk.hotspot.agent/sun.jvm.hotspot.oops
  57  *          jdk.hotspot.agent/sun.jvm.hotspot.debugger
  58  * @run main/othervm TestHeapDumpForInvokeDynamic
  59  */
  60 
  61 public class TestHeapDumpForInvokeDynamic {
  62 
  63     private static LingeredAppWithInvokeDynamic theApp = null;
  64 
  65     private static void verifyHeapDump(String heapFile) {
  66 
  67         File heapDumpFile = new File(heapFile);
  68         Asserts.assertTrue(heapDumpFile.exists() && heapDumpFile.isFile(),
  69                           "Could not create dump file " + heapDumpFile.getAbsolutePath());
  70         try (PositionDataInputStream in = new PositionDataInputStream(
  71                 new BufferedInputStream(new FileInputStream(heapFile)))) {
  72             int i = in.readInt();


< prev index next >