28 import java.util.Random;
29 import java.util.Vector;
30 import java.util.concurrent.CountDownLatch;
31 import java.util.concurrent.atomic.AtomicInteger;
32
33 import jdk.jfr.Recording;
34 import jdk.jfr.consumer.RecordedClass;
35 import jdk.jfr.consumer.RecordedEvent;
36 import jdk.jfr.consumer.RecordedFrame;
37 import jdk.jfr.consumer.RecordedMethod;
38 import jdk.jfr.consumer.RecordedObject;
39 import jdk.jfr.consumer.RecordedStackTrace;
40 import jdk.jfr.internal.test.WhiteBox;
41 import jdk.test.lib.jfr.EventNames;
42 import jdk.test.lib.jfr.Events;
43
44 /**
45 * @test
46 * @requires vm.flagless
47 * @requires vm.hasJFR
48 * @library /test/lib /test/jdk
49 * @modules jdk.jfr/jdk.jfr.internal.test
50 * @run main/othervm -XX:TLABSize=2k jdk.jfr.event.oldobject.TestLargeRootSet
51 */
52 public class TestLargeRootSet {
53 static class Node {
54 Node left;
55 Node right;
56 Object value;
57 }
58
59 static class Leak {
60 // Leaking object has to be of some size,
61 // otherwise Node object wins most of the
62 // slots in the object queue.
63 // In a normal application, objects would
64 // be of various size and allocated over a
65 // longer period of time. This would create
66 // randomness not present in the test.
67 public long value1;
|
28 import java.util.Random;
29 import java.util.Vector;
30 import java.util.concurrent.CountDownLatch;
31 import java.util.concurrent.atomic.AtomicInteger;
32
33 import jdk.jfr.Recording;
34 import jdk.jfr.consumer.RecordedClass;
35 import jdk.jfr.consumer.RecordedEvent;
36 import jdk.jfr.consumer.RecordedFrame;
37 import jdk.jfr.consumer.RecordedMethod;
38 import jdk.jfr.consumer.RecordedObject;
39 import jdk.jfr.consumer.RecordedStackTrace;
40 import jdk.jfr.internal.test.WhiteBox;
41 import jdk.test.lib.jfr.EventNames;
42 import jdk.test.lib.jfr.Events;
43
44 /**
45 * @test
46 * @requires vm.flagless
47 * @requires vm.hasJFR
48 * @requires !(vm.opt.final.UseCompactObjectHeaders == true | vm.opt.final.UseShenandoahGC == true)
49 * @library /test/lib /test/jdk
50 * @modules jdk.jfr/jdk.jfr.internal.test
51 * @run main/othervm -XX:TLABSize=2k jdk.jfr.event.oldobject.TestLargeRootSet
52 */
53 public class TestLargeRootSet {
54 static class Node {
55 Node left;
56 Node right;
57 Object value;
58 }
59
60 static class Leak {
61 // Leaking object has to be of some size,
62 // otherwise Node object wins most of the
63 // slots in the object queue.
64 // In a normal application, objects would
65 // be of various size and allocated over a
66 // longer period of time. This would create
67 // randomness not present in the test.
68 public long value1;
|