< prev index next >

test/jdk/jdk/jfr/event/oldobject/TestG1.java

Print this page

19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 
24 package jdk.jfr.event.oldobject;
25 
26 import java.util.ArrayList;
27 import java.util.List;
28 
29 import jdk.jfr.Recording;
30 import jdk.jfr.consumer.RecordedEvent;
31 import jdk.jfr.internal.test.WhiteBox;
32 import jdk.test.lib.jfr.EventNames;
33 import jdk.test.lib.jfr.Events;
34 
35 /**
36  * @test
37  * @requires vm.flagless
38  * @requires vm.hasJFR

39  * @requires vm.gc.G1
40  * @summary Test leak profiler with G1 GC
41  * @library /test/lib /test/jdk
42  * @modules jdk.jfr/jdk.jfr.internal.test
43  * @run main/othervm  -XX:TLABSize=2k -XX:+UseG1GC jdk.jfr.event.oldobject.TestG1
44  */
45 public class TestG1 {
46 
47     static private class FindMe {
48     }
49 
50     public static List<FindMe[]> list = new ArrayList<>(OldObjects.MIN_SIZE);
51 
52     public static void main(String[] args) throws Exception {
53         WhiteBox.setWriteAllObjectSamples(true);
54 
55         while (true) {
56             try (Recording r = new Recording()) {
57                 r.enable(EventNames.OldObjectSample).withStackTrace().with("cutoff", "infinity");
58                 r.start();

19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 
24 package jdk.jfr.event.oldobject;
25 
26 import java.util.ArrayList;
27 import java.util.List;
28 
29 import jdk.jfr.Recording;
30 import jdk.jfr.consumer.RecordedEvent;
31 import jdk.jfr.internal.test.WhiteBox;
32 import jdk.test.lib.jfr.EventNames;
33 import jdk.test.lib.jfr.Events;
34 
35 /**
36  * @test
37  * @requires vm.flagless
38  * @requires vm.hasJFR
39  * @requires vm.opt.final.UseCompactObjectHeaders == false
40  * @requires vm.gc.G1
41  * @summary Test leak profiler with G1 GC
42  * @library /test/lib /test/jdk
43  * @modules jdk.jfr/jdk.jfr.internal.test
44  * @run main/othervm  -XX:TLABSize=2k -XX:+UseG1GC jdk.jfr.event.oldobject.TestG1
45  */
46 public class TestG1 {
47 
48     static private class FindMe {
49     }
50 
51     public static List<FindMe[]> list = new ArrayList<>(OldObjects.MIN_SIZE);
52 
53     public static void main(String[] args) throws Exception {
54         WhiteBox.setWriteAllObjectSamples(true);
55 
56         while (true) {
57             try (Recording r = new Recording()) {
58                 r.enable(EventNames.OldObjectSample).withStackTrace().with("cutoff", "infinity");
59                 r.start();
< prev index next >