hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java
changeset 41092 c388d897472d
parent 40855 3c4c913195e3
child 41705 332239c052cc
equal deleted inserted replaced
41091:de3789bb384e 41092:c388d897472d
    44 import java.util.regex.Pattern;
    44 import java.util.regex.Pattern;
    45 import jdk.internal.misc.Unsafe;
    45 import jdk.internal.misc.Unsafe;
    46 import jdk.test.lib.process.OutputAnalyzer;
    46 import jdk.test.lib.process.OutputAnalyzer;
    47 import jdk.test.lib.process.ProcessTools;
    47 import jdk.test.lib.process.ProcessTools;
    48 import jdk.test.lib.Utils;
    48 import jdk.test.lib.Utils;
    49 import jdk.test.lib.unsafe.UnsafeHelper;
       
    50 import sun.hotspot.WhiteBox;
    49 import sun.hotspot.WhiteBox;
    51 
    50 
    52 /* In order to test that TargetSurvivorRatio affects survivor space occupancy
    51 /* In order to test that TargetSurvivorRatio affects survivor space occupancy
    53  * we setup fixed MaxTenuringThreshold and then verifying that if size of allocated
    52  * we setup fixed MaxTenuringThreshold and then verifying that if size of allocated
    54  * objects is lower than (survivor_size * TargetSurvivorRatio / 100) then objects
    53  * objects is lower than (survivor_size * TargetSurvivorRatio / 100) then objects
   247     }
   246     }
   248 
   247 
   249     public static class TargetSurvivorRatioVerifier {
   248     public static class TargetSurvivorRatioVerifier {
   250 
   249 
   251         static final WhiteBox wb = WhiteBox.getWhiteBox();
   250         static final WhiteBox wb = WhiteBox.getWhiteBox();
   252         static final Unsafe unsafe = UnsafeHelper.getUnsafe();
   251         static final Unsafe unsafe = Unsafe.getUnsafe();
   253 
   252 
   254         // Desired size of memory allocated at once
   253         // Desired size of memory allocated at once
   255         public static final int CHUNK_SIZE = 1024;
   254         public static final int CHUNK_SIZE = 1024;
   256         // Length of byte[] array that will have occupy CHUNK_SIZE bytes in heap
   255         // Length of byte[] array that will have occupy CHUNK_SIZE bytes in heap
   257         public static final int ARRAY_LENGTH = CHUNK_SIZE - Unsafe.ARRAY_BYTE_BASE_OFFSET;
   256         public static final int ARRAY_LENGTH = CHUNK_SIZE - Unsafe.ARRAY_BYTE_BASE_OFFSET;