19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jfr.event.compiler;
27
28 import static java.lang.Math.floor;
29 import static jdk.test.lib.Asserts.assertGreaterThanOrEqual;
30 import static jdk.test.lib.Asserts.assertLessThanOrEqual;
31
32 import java.time.Duration;
33
34 import jdk.jfr.Recording;
35 import jdk.jfr.consumer.RecordedEvent;
36 import jdk.test.lib.jfr.EventNames;
37 import jdk.test.lib.jfr.Events;
38
39 /*
40 * @test
41 * @summary Test that when an object is allocated outside a TLAB an event will be triggered.
42 * @key jfr
43 * @library /test/lib
44 * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB
45 * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB
46 * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 -Xint jdk.jfr.event.compiler.TestAllocOutsideTLAB
47 */
48
49 /**
50 * Test that an event is triggered when an object is allocated outside a
51 * Thread Local Allocation Buffer (TLAB). The test is done for C1-compiler,
52 * C2-compiler (-XX:-FastTLABRefill) and interpreted mode (-Xint).
53 *
54 * To force objects to be allocated outside TLAB:
55 * the size of TLAB is set to 90k (-XX:TLABSize=90k);
56 * the size of allocated objects is set to 100k.
57 * max TLAB waste at refill is set to 256 (-XX:TLABRefillWasteFraction=256),
58 * to prevent a new TLAB creation.
59 */
60 public class TestAllocOutsideTLAB {
61 private static final String EVENT_NAME = EventNames.ObjectAllocationOutsideTLAB;
62
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jfr.event.compiler;
27
28 import static java.lang.Math.floor;
29 import static jdk.test.lib.Asserts.assertGreaterThanOrEqual;
30 import static jdk.test.lib.Asserts.assertLessThanOrEqual;
31
32 import java.time.Duration;
33
34 import jdk.jfr.Recording;
35 import jdk.jfr.consumer.RecordedEvent;
36 import jdk.test.lib.jfr.EventNames;
37 import jdk.test.lib.jfr.Events;
38
39 /**
40 * @test
41 * @summary Test that when an object is allocated outside a TLAB an event will be triggered.
42 * @key jfr
43 * @requires vm.hasJFR
44 * @library /test/lib
45 * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB
46 * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB
47 * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 -Xint jdk.jfr.event.compiler.TestAllocOutsideTLAB
48 */
49
50 /**
51 * Test that an event is triggered when an object is allocated outside a
52 * Thread Local Allocation Buffer (TLAB). The test is done for C1-compiler,
53 * C2-compiler (-XX:-FastTLABRefill) and interpreted mode (-Xint).
54 *
55 * To force objects to be allocated outside TLAB:
56 * the size of TLAB is set to 90k (-XX:TLABSize=90k);
57 * the size of allocated objects is set to 100k.
58 * max TLAB waste at refill is set to 256 (-XX:TLABRefillWasteFraction=256),
59 * to prevent a new TLAB creation.
60 */
61 public class TestAllocOutsideTLAB {
62 private static final String EVENT_NAME = EventNames.ObjectAllocationOutsideTLAB;
63
|