< prev index next >

test/hotspot/jtreg/vmTestbase/gc/memory/LargePagesTest/LargePagesTest.java

Print this page
rev 59093 : [mq]: randomness-code_vmTestbase_gc

@@ -35,11 +35,11 @@
  */
 
 package gc.memory.LargePagesTest;
 
 import java.io.PrintStream;
-import java.util.Random;
+import nsk.share.test.LocalRandom;
 
 /*
  * Allocators purpose is to create pressure on the garbage collector
  * for a certain amount of time.
  * Note: this test moved from the "jr", the original name is func.vm.largepages.LargePagesTest

@@ -156,28 +156,25 @@
             result = true;
         }
     }
 
     private void allocate() {
-
-        Random r = new Random();
         for (int j = 0; j < 1000; j++) {
-            r = new Random();
             int i = 0;
 
             switch (myType) {
             case SMALL_OBJECT_ALLOCATER:
                 i = 5;
                 break;
             case LARGE_OBJECT_ALLOCATER:
                 i = 1;
                 break;
             case ANY_OBJECT_ALLOCATER:
-                i = r.nextInt(100);
+                i = LocalRandom.nextInt(100);
                 break;
             case ANY_NO_MULTIARRAYS_ALLOCATER:
-                i = r.nextInt(100);
+                i = LocalRandom.nextInt(100);
                 if ((i >= 2) && (i <= 4)) {
                     i = 5;
                 }
                 break;
             default:
< prev index next >