< prev index next >

test/gc/g1/plab/TestPLABPromotion.java

Print this page




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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  /*
  25  * @test TestPLABPromotion
  26  * @bug 8141278 8141141
  27  * @summary Test PLAB promotion
  28  * @requires vm.gc.G1
  29  * @requires !vm.flightRecorder
  30  * @library /testlibrary /test/lib /
  31  * @modules java.base/jdk.internal.misc
  32  * @modules java.management
  33  * @build ClassFileInstaller
  34  *        sun.hotspot.WhiteBox
  35  *        gc.g1.plab.lib.MemoryConsumer
  36  *        gc.g1.plab.lib.LogParser
  37  *        gc.g1.plab.lib.AppPLABPromotion
  38  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  39  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  40  * @run main/timeout=240 gc.g1.plab.TestPLABPromotion
  41  */
  42 package gc.g1.plab;
  43 
  44 import java.util.List;
  45 import java.util.Arrays;
  46 import java.io.PrintStream;
  47 
  48 import gc.g1.plab.lib.AppPLABPromotion;
  49 import gc.g1.plab.lib.LogParser;
  50 import gc.g1.plab.lib.PLABUtils;
  51 import gc.g1.plab.lib.PlabInfo;
  52 
  53 import jdk.test.lib.OutputAnalyzer;
  54 import jdk.test.lib.ProcessTools;
  55 
  56 /**
  57  * Test checks PLAB promotion of different size objects.
  58  */
  59 public class TestPLABPromotion {
  60 
  61     // GC ID with survivor PLAB statistics
  62     private final static long GC_ID_SURVIVOR_STATS = 1l;
  63     // GC ID with old PLAB statistics
  64     private final static long GC_ID_OLD_STATS = 2l;
  65 
  66     private final static String PLAB_USED_FIELD_NAME = "used";
  67     private final static String PLAB_DIRECT_ALLOCATED_FIELD_NAME = "direct allocated";
  68     private final static List<String> FIELDS_TO_EXTRACT = Arrays.asList(PLAB_USED_FIELD_NAME, PLAB_DIRECT_ALLOCATED_FIELD_NAME);
  69 
  70     private static String output;
  71 
  72     // Allowable difference for memory consumption (percentage)
  73     private final static long MEM_DIFFERENCE_PCT = 5;
  74 




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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  /*
  25  * @test TestPLABPromotion
  26  * @bug 8141278 8141141
  27  * @summary Test PLAB promotion
  28  * @requires vm.gc.G1
  29  * @requires !vm.flightRecorder
  30  * @library /test/lib /
  31  * @modules java.base/jdk.internal.misc
  32  * @modules java.management
  33  * @build sun.hotspot.WhiteBox




  34  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  35  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  36  * @run main/timeout=240 gc.g1.plab.TestPLABPromotion
  37  */
  38 package gc.g1.plab;
  39 
  40 import java.util.List;
  41 import java.util.Arrays;
  42 import java.io.PrintStream;
  43 
  44 import gc.g1.plab.lib.AppPLABPromotion;
  45 import gc.g1.plab.lib.LogParser;
  46 import gc.g1.plab.lib.PLABUtils;
  47 import gc.g1.plab.lib.PlabInfo;
  48 
  49 import jdk.test.lib.process.OutputAnalyzer;
  50 import jdk.test.lib.process.ProcessTools;
  51 
  52 /**
  53  * Test checks PLAB promotion of different size objects.
  54  */
  55 public class TestPLABPromotion {
  56 
  57     // GC ID with survivor PLAB statistics
  58     private final static long GC_ID_SURVIVOR_STATS = 1l;
  59     // GC ID with old PLAB statistics
  60     private final static long GC_ID_OLD_STATS = 2l;
  61 
  62     private final static String PLAB_USED_FIELD_NAME = "used";
  63     private final static String PLAB_DIRECT_ALLOCATED_FIELD_NAME = "direct allocated";
  64     private final static List<String> FIELDS_TO_EXTRACT = Arrays.asList(PLAB_USED_FIELD_NAME, PLAB_DIRECT_ALLOCATED_FIELD_NAME);
  65 
  66     private static String output;
  67 
  68     // Allowable difference for memory consumption (percentage)
  69     private final static long MEM_DIFFERENCE_PCT = 5;
  70 


< prev index next >