< prev index next >

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

Print this page

17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
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.internal.test.WhiteBox;
31 import jdk.test.lib.jfr.EventNames;
32 
33 /**
34  * @test
35  * @requires vm.flagless
36  * @requires vm.hasJFR

37  * @library /test/lib /test/jdk
38  * @modules jdk.jfr/jdk.jfr.internal.test
39  * @run main/othervm -XX:TLABSize=2k jdk.jfr.event.oldobject.TestHeapShallow
40  */
41 public class TestHeapShallow {
42     private final static long LARGE_OBJECT_FACTOR = 509; // prime number
43 
44     static class LeakObject {
45         Object object = null;
46 
47         public LeakObject(Object object) {
48             this.object = object;
49         }
50     }
51 
52     public static ArrayList<LeakObject> leak =  new ArrayList<>(OldObjects.MIN_SIZE);
53 
54     public static void main(String[] args) throws Exception {
55         WhiteBox.setWriteAllObjectSamples(true);
56 

17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
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.internal.test.WhiteBox;
31 import jdk.test.lib.jfr.EventNames;
32 
33 /**
34  * @test
35  * @requires vm.flagless
36  * @requires vm.hasJFR
37  * @requires !(vm.opt.final.UseCompactObjectHeaders == true | vm.opt.final.UseShenandoahGC == true)
38  * @library /test/lib /test/jdk
39  * @modules jdk.jfr/jdk.jfr.internal.test
40  * @run main/othervm -XX:TLABSize=2k jdk.jfr.event.oldobject.TestHeapShallow
41  */
42 public class TestHeapShallow {
43     private final static long LARGE_OBJECT_FACTOR = 509; // prime number
44 
45     static class LeakObject {
46         Object object = null;
47 
48         public LeakObject(Object object) {
49             this.object = object;
50         }
51     }
52 
53     public static ArrayList<LeakObject> leak =  new ArrayList<>(OldObjects.MIN_SIZE);
54 
55     public static void main(String[] args) throws Exception {
56         WhiteBox.setWriteAllObjectSamples(true);
57 
< prev index next >