< prev index next >

test/jdk/jdk/jfr/event/compiler/TestAllocInNewTLAB.java

Print this page
rev 51054 : imported patch 9000013-aixDisableJFR-requires.patch


  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 event is triggered when an object is allocated in a new TLAB.
  42  * @key jfr

  43  * @library /test/lib
  44  * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 jdk.jfr.event.compiler.TestAllocInNewTLAB
  45  * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 -XX:-FastTLABRefill jdk.jfr.event.compiler.TestAllocInNewTLAB
  46  * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 -Xint jdk.jfr.event.compiler.TestAllocInNewTLAB
  47  */
  48 
  49 /**
  50  * Test that when an object is allocated in a new Thread Local Allocation Buffer (TLAB)
  51  * an event will be triggered. The test is done for C1-compiler,
  52  * C2-compiler (-XX:-FastTLABRefill) and interpreted mode (-Xint).
  53  *
  54  * To force objects to be allocated in a new TLAB:
  55  *      the size of TLAB is set to 100k (-XX:TLABSize=100k);
  56  *      the size of allocated objects is set to 100k minus 16 bytes overhead;
  57  *      max TLAB waste at refill is set to minimum (-XX:TLABRefillWasteFraction=1),
  58  *          to provoke a new TLAB creation.
  59  */
  60 public class TestAllocInNewTLAB {
  61     private final static String EVENT_NAME = EventNames.ObjectAllocationInNewTLAB;
  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 event is triggered when an object is allocated in a new TLAB.
  42  * @key jfr
  43  * @requires vm.hasJFR
  44  * @library /test/lib
  45  * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 jdk.jfr.event.compiler.TestAllocInNewTLAB
  46  * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 -XX:-FastTLABRefill jdk.jfr.event.compiler.TestAllocInNewTLAB
  47  * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 -Xint jdk.jfr.event.compiler.TestAllocInNewTLAB
  48  */
  49 
  50 /**
  51  * Test that when an object is allocated in a new Thread Local Allocation Buffer (TLAB)
  52  * an event will be triggered. The test is done for C1-compiler,
  53  * C2-compiler (-XX:-FastTLABRefill) and interpreted mode (-Xint).
  54  *
  55  * To force objects to be allocated in a new TLAB:
  56  *      the size of TLAB is set to 100k (-XX:TLABSize=100k);
  57  *      the size of allocated objects is set to 100k minus 16 bytes overhead;
  58  *      max TLAB waste at refill is set to minimum (-XX:TLABRefillWasteFraction=1),
  59  *          to provoke a new TLAB creation.
  60  */
  61 public class TestAllocInNewTLAB {
  62     private final static String EVENT_NAME = EventNames.ObjectAllocationInNewTLAB;
  63 


< prev index next >