test/gc/stress/systemgc/TestSystemGC.java

Print this page




 165             ShortLivedAllocationTask shortTask =
 166                 (i == 1 || i == 3) ?  new ShortLivedAllocationTask() : null;
 167             LongLivedAllocationTask longTask =
 168                 (i == 2 || i == 3) ? new LongLivedAllocationTask(longLivedMap) : null;
 169 
 170             startTask(gcTask);
 171             startTask(shortTask);
 172             startTask(longTask);
 173 
 174             doSystemGCs();
 175 
 176             exitTask(gcTask);
 177             exitTask(shortTask);
 178             exitTask(longTask);
 179 
 180             ThreadUtils.sleep(1000);
 181         }
 182     }
 183 
 184     public static void main(String[] args) {
 185         // First allocate the long lived objects and then run all phases twice.
 186         populateLongLived();
 187         runAllPhases();

 188         runAllPhases();

 189     }
 190 }


 165             ShortLivedAllocationTask shortTask =
 166                 (i == 1 || i == 3) ?  new ShortLivedAllocationTask() : null;
 167             LongLivedAllocationTask longTask =
 168                 (i == 2 || i == 3) ? new LongLivedAllocationTask(longLivedMap) : null;
 169 
 170             startTask(gcTask);
 171             startTask(shortTask);
 172             startTask(longTask);
 173 
 174             doSystemGCs();
 175 
 176             exitTask(gcTask);
 177             exitTask(shortTask);
 178             exitTask(longTask);
 179 
 180             ThreadUtils.sleep(1000);
 181         }
 182     }
 183 
 184     public static void main(String[] args) {
 185         // First allocate the long lived objects and then run all phases.
 186         populateLongLived();
 187         runAllPhases();
 188         if (args.length > 0 && args[0].equals("long")) {
 189             runAllPhases();
 190         }
 191     }
 192 }