hotspot/test/gc/arguments/TestMaxMinHeapFreeRatioFlags.java
changeset 41092 c388d897472d
parent 40855 3c4c913195e3
child 41705 332239c052cc
equal deleted inserted replaced
41091:de3789bb384e 41092:c388d897472d
    35 import java.util.Arrays;
    35 import java.util.Arrays;
    36 import java.util.Collections;
    36 import java.util.Collections;
    37 import jdk.test.lib.process.OutputAnalyzer;
    37 import jdk.test.lib.process.OutputAnalyzer;
    38 import jdk.test.lib.process.ProcessTools;
    38 import jdk.test.lib.process.ProcessTools;
    39 import jdk.test.lib.Utils;
    39 import jdk.test.lib.Utils;
    40 import jdk.test.lib.unsafe.UnsafeHelper;
       
    41 import jdk.internal.misc.Unsafe;
    40 import jdk.internal.misc.Unsafe;
    42 
    41 
    43 public class TestMaxMinHeapFreeRatioFlags {
    42 public class TestMaxMinHeapFreeRatioFlags {
    44 
    43 
    45     public static final long M = 1024 * 1024;
    44     public static final long M = 1024 * 1024;
   132      * RatioVerifier will be executed in the tested VM.
   131      * RatioVerifier will be executed in the tested VM.
   133      * It will check that real heap usage after collection lies between MinHeapFreeRatio and MaxHeapFreeRatio.
   132      * It will check that real heap usage after collection lies between MinHeapFreeRatio and MaxHeapFreeRatio.
   134      */
   133      */
   135     public static class RatioVerifier {
   134     public static class RatioVerifier {
   136 
   135 
   137         private static final Unsafe unsafe = UnsafeHelper.getUnsafe();
   136         private static final Unsafe unsafe = Unsafe.getUnsafe();
   138 
   137 
   139         // Size of byte array that will be allocated
   138         // Size of byte array that will be allocated
   140         public static final int CHUNK_SIZE = 1024;
   139         public static final int CHUNK_SIZE = 1024;
   141         // Length of byte array, that will be added to "garbage" list.
   140         // Length of byte array, that will be added to "garbage" list.
   142         public static final int ARRAY_LENGTH = CHUNK_SIZE - Unsafe.ARRAY_BYTE_BASE_OFFSET;
   141         public static final int ARRAY_LENGTH = CHUNK_SIZE - Unsafe.ARRAY_BYTE_BASE_OFFSET;