Java Code Examples for sun.hotspot.WhiteBox#fullGC()
The following examples show how to use
sun.hotspot.WhiteBox#fullGC() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SanityTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String... args) { WhiteBox wb = WhiteBox.getWhiteBox(); StringBuilder sb = new StringBuilder(); sb.append("1234x"); sb.append("x56789"); String str = sb.toString(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is already interned"); } str.intern(); if (!wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is not interned"); } str = sb.toString(); wb.fullGC(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is in StringTable even after GC"); } }
Example 2
Source File: SanityTest.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String... args) { WhiteBox wb = WhiteBox.getWhiteBox(); StringBuilder sb = new StringBuilder(); sb.append("1234x"); sb.append("x56789"); String str = sb.toString(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is already interned"); } str.intern(); if (!wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is not interned"); } str = sb.toString(); wb.fullGC(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is in StringTable even after GC"); } }
Example 3
Source File: SanityTest.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public static void main(String... args) { WhiteBox wb = WhiteBox.getWhiteBox(); StringBuilder sb = new StringBuilder(); sb.append("1234x"); sb.append("x56789"); String str = sb.toString(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is already interned"); } str.intern(); if (!wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is not interned"); } str = sb.toString(); wb.fullGC(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is in StringTable even after GC"); } }
Example 4
Source File: SanityTest.java From hottub with GNU General Public License v2.0 | 6 votes |
public static void main(String... args) { WhiteBox wb = WhiteBox.getWhiteBox(); StringBuilder sb = new StringBuilder(); sb.append("1234x"); sb.append("x56789"); String str = sb.toString(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is already interned"); } str.intern(); if (!wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is not interned"); } str = sb.toString(); wb.fullGC(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is in StringTable even after GC"); } }
Example 5
Source File: TestConcMarkCycleWB.java From hottub with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { WhiteBox wb = WhiteBox.getWhiteBox(); wb.youngGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } wb.fullGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } assertTrue(wb.g1StartConcMarkCycle()); }
Example 6
Source File: SanityTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static void main(String... args) { WhiteBox wb = WhiteBox.getWhiteBox(); StringBuilder sb = new StringBuilder(); sb.append("1234x"); sb.append("x56789"); String str = sb.toString(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is already interned"); } str.intern(); if (!wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is not interned"); } str = sb.toString(); wb.fullGC(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is in StringTable even after GC"); } }
Example 7
Source File: TestConcMarkCycleWB.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { WhiteBox wb = WhiteBox.getWhiteBox(); wb.youngGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } wb.fullGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } assertTrue(wb.g1StartConcMarkCycle()); }
Example 8
Source File: TestConcMarkCycleWB.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { WhiteBox wb = WhiteBox.getWhiteBox(); wb.youngGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } wb.fullGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } assertTrue(wb.g1StartConcMarkCycle()); }
Example 9
Source File: TestConcMarkCycleWB.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { WhiteBox wb = WhiteBox.getWhiteBox(); wb.youngGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } wb.fullGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } assertTrue(wb.g1StartConcMarkCycle()); }
Example 10
Source File: SanityTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void main(String... args) { WhiteBox wb = WhiteBox.getWhiteBox(); StringBuilder sb = new StringBuilder(); sb.append("1234x"); sb.append("x56789"); String str = sb.toString(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is already interned"); } str.intern(); if (!wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is not interned"); } str = sb.toString(); wb.fullGC(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is in StringTable even after GC"); } }
Example 11
Source File: TestConcMarkCycleWB.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { WhiteBox wb = WhiteBox.getWhiteBox(); wb.youngGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } wb.fullGC(); assertTrue(wb.g1StartConcMarkCycle()); while (wb.g1InConcurrentMark()) { Thread.sleep(5); } assertTrue(wb.g1StartConcMarkCycle()); }
Example 12
Source File: SanityTest.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public static void main(String... args) { WhiteBox wb = WhiteBox.getWhiteBox(); StringBuilder sb = new StringBuilder(); sb.append("1234x"); sb.append("x56789"); String str = sb.toString(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is already interned"); } str.intern(); if (!wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is not interned"); } str = sb.toString(); wb.fullGC(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is in StringTable even after GC"); } }
Example 13
Source File: SanityTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String... args) { WhiteBox wb = WhiteBox.getWhiteBox(); StringBuilder sb = new StringBuilder(); sb.append("1234x"); sb.append("x56789"); String str = sb.toString(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is already interned"); } str.intern(); if (!wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is not interned"); } str = sb.toString(); wb.fullGC(); if (wb.isInStringTable(str)) { throw new RuntimeException("String " + str + " is in StringTable even after GC"); } }
Example 14
Source File: TestNoEagerReclaimOfHumongousRegions.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws InterruptedException{ WhiteBox wb = WhiteBox.getWhiteBox(); LinkedList<Object> garbageAndRefList = new LinkedList<Object>(); // Creating a 1M large byte array. Since the test specifies the heap // region size to be 1m this will be a humongous object. We then // store a pointer to the array in the static object to keep it live // during the whole test. humongous_reference_holder = new LargeRef(new byte[1 * 1024 * 1024]); // Create some garbage and a reference to the humongous object each round. for (int i = 0; i < 32; i++) { garbageAndRefList.add(new byte[400*1000]); garbageAndRefList.add(new LargeRef(humongous_reference_holder.ref())); // Promote to old, goal is to get rem-set entries for the humongous // object from different regions. The test specifies MaxTenuringThreshold=0, // this will make sure we get objects promoted to old at once. wb.youngGC(); } // Clear the garbage and reference list. garbageAndRefList.clear(); // Run a concurrent mark cycle to mark all references but the static one as dead. wb.g1StartConcMarkCycle(); while (wb.g1InConcurrentMark()) { Thread.sleep(100); } // Run a young collection to make sure humongous object still can't be eagerly reclaimed. wb.youngGC(); // Will crash/assert if humongous object has been reclaimed. wb.fullGC(); }
Example 15
Source File: TestRemsetLoggingTools.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { int numGCs = Integer.parseInt(args[0]); // Perform the requested amount of GCs. WhiteBox wb = WhiteBox.getWhiteBox(); for (int i = 0; i < numGCs - 1; i++) { wb.youngGC(); } if (numGCs > 0) { wb.fullGC(); } }
Example 16
Source File: TestNoEagerReclaimOfHumongousRegions.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws InterruptedException{ WhiteBox wb = WhiteBox.getWhiteBox(); LinkedList<Object> garbageAndRefList = new LinkedList<Object>(); // Creating a 1M large byte array. Since the test specifies the heap // region size to be 1m this will be a humongous object. We then // store a pointer to the array in the static object to keep it live // during the whole test. humongous_reference_holder = new LargeRef(new byte[1 * 1024 * 1024]); // Create some garbage and a reference to the humongous object each round. for (int i = 0; i < 32; i++) { garbageAndRefList.add(new byte[400*1000]); garbageAndRefList.add(new LargeRef(humongous_reference_holder.ref())); // Promote to old, goal is to get rem-set entries for the humongous // object from different regions. The test specifies MaxTenuringThreshold=0, // this will make sure we get objects promoted to old at once. wb.youngGC(); } // Clear the garbage and reference list. garbageAndRefList.clear(); // Run a concurrent mark cycle to mark all references but the static one as dead. wb.g1StartConcMarkCycle(); while (wb.g1InConcurrentMark()) { Thread.sleep(100); } // Run a young collection to make sure humongous object still can't be eagerly reclaimed. wb.youngGC(); // Will crash/assert if humongous object has been reclaimed. wb.fullGC(); }
Example 17
Source File: TestNoEagerReclaimOfHumongousRegions.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws InterruptedException{ WhiteBox wb = WhiteBox.getWhiteBox(); LinkedList<Object> garbageAndRefList = new LinkedList<Object>(); // Creating a 1M large byte array. Since the test specifies the heap // region size to be 1m this will be a humongous object. We then // store a pointer to the array in the static object to keep it live // during the whole test. humongous_reference_holder = new LargeRef(new byte[1 * 1024 * 1024]); // Create some garbage and a reference to the humongous object each round. for (int i = 0; i < 32; i++) { garbageAndRefList.add(new byte[400*1000]); garbageAndRefList.add(new LargeRef(humongous_reference_holder.ref())); // Promote to old, goal is to get rem-set entries for the humongous // object from different regions. The test specifies MaxTenuringThreshold=0, // this will make sure we get objects promoted to old at once. wb.youngGC(); } // Clear the garbage and reference list. garbageAndRefList.clear(); // Run a concurrent mark cycle to mark all references but the static one as dead. wb.g1StartConcMarkCycle(); while (wb.g1InConcurrentMark()) { Thread.sleep(100); } // Run a young collection to make sure humongous object still can't be eagerly reclaimed. wb.youngGC(); // Will crash/assert if humongous object has been reclaimed. wb.fullGC(); }
Example 18
Source File: TestNoEagerReclaimOfHumongousRegions.java From hottub with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws InterruptedException{ WhiteBox wb = WhiteBox.getWhiteBox(); LinkedList<Object> garbageAndRefList = new LinkedList<Object>(); // Creating a 1M large byte array. Since the test specifies the heap // region size to be 1m this will be a humongous object. We then // store a pointer to the array in the static object to keep it live // during the whole test. humongous_reference_holder = new LargeRef(new byte[1 * 1024 * 1024]); // Create some garbage and a reference to the humongous object each round. for (int i = 0; i < 32; i++) { garbageAndRefList.add(new byte[400*1000]); garbageAndRefList.add(new LargeRef(humongous_reference_holder.ref())); // Promote to old, goal is to get rem-set entries for the humongous // object from different regions. The test specifies MaxTenuringThreshold=0, // this will make sure we get objects promoted to old at once. wb.youngGC(); } // Clear the garbage and reference list. garbageAndRefList.clear(); // Run a concurrent mark cycle to mark all references but the static one as dead. wb.g1StartConcMarkCycle(); while (wb.g1InConcurrentMark()) { Thread.sleep(100); } // Run a young collection to make sure humongous object still can't be eagerly reclaimed. wb.youngGC(); // Will crash/assert if humongous object has been reclaimed. wb.fullGC(); }
Example 19
Source File: TestNoEagerReclaimOfHumongousRegions.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws InterruptedException{ WhiteBox wb = WhiteBox.getWhiteBox(); LinkedList<Object> garbageAndRefList = new LinkedList<Object>(); // Creating a 1M large byte array. Since the test specifies the heap // region size to be 1m this will be a humongous object. We then // store a pointer to the array in the static object to keep it live // during the whole test. humongous_reference_holder = new LargeRef(new byte[1 * 1024 * 1024]); // Create some garbage and a reference to the humongous object each round. for (int i = 0; i < 32; i++) { garbageAndRefList.add(new byte[400*1000]); garbageAndRefList.add(new LargeRef(humongous_reference_holder.ref())); // Promote to old, goal is to get rem-set entries for the humongous // object from different regions. The test specifies MaxTenuringThreshold=0, // this will make sure we get objects promoted to old at once. wb.youngGC(); } // Clear the garbage and reference list. garbageAndRefList.clear(); // Run a concurrent mark cycle to mark all references but the static one as dead. wb.g1StartConcMarkCycle(); while (wb.g1InConcurrentMark()) { Thread.sleep(100); } // Run a young collection to make sure humongous object still can't be eagerly reclaimed. wb.youngGC(); // Will crash/assert if humongous object has been reclaimed. wb.fullGC(); }