< prev index next >

test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java

Print this page




 149                 } catch (InterruptedException e) {
 150                     System.out.println("Got InterruptedException while waiting for ConcMarkCycle to finish");
 151                 }
 152             }
 153         }
 154     }
 155 
 156 
 157 
 158     public static void main(String args[]) throws Exception {
 159         // allocate old objects
 160         allocateOldObjects();
 161         waitTillCMCFinished(WB, 0);
 162         WB.g1StartConcMarkCycle();
 163         waitTillCMCFinished(WB, 0);
 164 
 165         WB.youngGC();
 166         System.out.println("Allocating new objects to provoke mixed GC");
 167         // allocate more objects to provoke GC
 168         for (int i = 0; i < (TestLogging.ALLOCATION_COUNT * 20); i++) {

 169             newObjects.add(new byte[TestLogging.ALLOCATION_SIZE]);






 170         }
 171         // check that liveOldObjects still alive
 172         Asserts.assertTrue(WB.isObjectInOldGen(liveOldObjects),
 173                 "List of the objects is suppose to be in OldGen");
 174     }
 175 }


 149                 } catch (InterruptedException e) {
 150                     System.out.println("Got InterruptedException while waiting for ConcMarkCycle to finish");
 151                 }
 152             }
 153         }
 154     }
 155 
 156 
 157 
 158     public static void main(String args[]) throws Exception {
 159         // allocate old objects
 160         allocateOldObjects();
 161         waitTillCMCFinished(WB, 0);
 162         WB.g1StartConcMarkCycle();
 163         waitTillCMCFinished(WB, 0);
 164 
 165         WB.youngGC();
 166         System.out.println("Allocating new objects to provoke mixed GC");
 167         // allocate more objects to provoke GC
 168         for (int i = 0; i < (TestLogging.ALLOCATION_COUNT * 20); i++) {
 169             try {
 170                 newObjects.add(new byte[TestLogging.ALLOCATION_SIZE]);
 171             } catch (OutOfMemoryError e) {
 172                 newObjects.clear();
 173                 WB.youngGC();
 174                 WB.youngGC();
 175                 break;
 176             }
 177         }
 178         // check that liveOldObjects still alive
 179         Asserts.assertTrue(WB.isObjectInOldGen(liveOldObjects),
 180                 "List of the objects is suppose to be in OldGen");
 181     }
 182 }
< prev index next >