test/gc/g1/TestShrinkAuxiliaryData.java

Print this page




  52 
  53     protected TestShrinkAuxiliaryData(int RSetCacheSize) {
  54         this.RSetCacheSize = RSetCacheSize;
  55     }
  56 
  57     protected void test() throws Exception {
  58         ArrayList<String> vmOpts = new ArrayList();
  59         Collections.addAll(vmOpts, initialOpts);
  60 
  61         int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
  62         if (maxCacheSize < RSetCacheSize) {
  63             System.out.format("Skiping test for %d cache size due max cache size %d",
  64                     RSetCacheSize, maxCacheSize
  65             );
  66             return;
  67         }
  68 
  69         printTestInfo(maxCacheSize);
  70 
  71         vmOpts.add("-XX:G1ConcRSLogCacheSize=" + RSetCacheSize);
  72 
  73         vmOpts.addAll(Arrays.asList(Utils.getFilteredTestJavaOpts(
  74                 ShrinkAuxiliaryDataTest.prohibitedVmOptions)));
  75 
  76         // for 32 bits ObjectAlignmentInBytes is not a option
  77         if (Platform.is32bit()) {
  78             ArrayList<String> vmOptsWithoutAlign = new ArrayList(vmOpts);
  79             vmOptsWithoutAlign.add(ShrinkAuxiliaryDataTest.class.getName());
  80             performTest(vmOptsWithoutAlign);
  81             return;
  82         }
  83 
  84         for (int alignment = 3; alignment <= 8; alignment++) {
  85             ArrayList<String> vmOptsWithAlign = new ArrayList(vmOpts);
  86             vmOptsWithAlign.add("-XX:ObjectAlignmentInBytes="
  87                     + (int) Math.pow(2, alignment));
  88             vmOptsWithAlign.add(ShrinkAuxiliaryDataTest.class.getName());
  89 
  90             performTest(vmOptsWithAlign);
  91         }
  92     }
  93 
  94     private void performTest(List<String> opts) throws Exception {




  52 
  53     protected TestShrinkAuxiliaryData(int RSetCacheSize) {
  54         this.RSetCacheSize = RSetCacheSize;
  55     }
  56 
  57     protected void test() throws Exception {
  58         ArrayList<String> vmOpts = new ArrayList();
  59         Collections.addAll(vmOpts, initialOpts);
  60 
  61         int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
  62         if (maxCacheSize < RSetCacheSize) {
  63             System.out.format("Skiping test for %d cache size due max cache size %d",
  64                     RSetCacheSize, maxCacheSize
  65             );
  66             return;
  67         }
  68 
  69         printTestInfo(maxCacheSize);
  70 
  71         vmOpts.add("-XX:G1ConcRSLogCacheSize=" + RSetCacheSize);
  72         vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));


  73 
  74         // for 32 bits ObjectAlignmentInBytes is not a option
  75         if (Platform.is32bit()) {
  76             ArrayList<String> vmOptsWithoutAlign = new ArrayList(vmOpts);
  77             vmOptsWithoutAlign.add(ShrinkAuxiliaryDataTest.class.getName());
  78             performTest(vmOptsWithoutAlign);
  79             return;
  80         }
  81 
  82         for (int alignment = 3; alignment <= 8; alignment++) {
  83             ArrayList<String> vmOptsWithAlign = new ArrayList(vmOpts);
  84             vmOptsWithAlign.add("-XX:ObjectAlignmentInBytes="
  85                     + (int) Math.pow(2, alignment));
  86             vmOptsWithAlign.add(ShrinkAuxiliaryDataTest.class.getName());
  87 
  88             performTest(vmOptsWithAlign);
  89         }
  90     }
  91 
  92     private void performTest(List<String> opts) throws Exception {