Java Code Examples for sun.hotspot.WhiteBox#deoptimizeAll()

The following examples show how to use sun.hotspot.WhiteBox#deoptimizeAll() . 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: TestHumongousCodeCacheRoots.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) throws Exception {
    // do some work so that the compiler compiles this method, inlining the
    // reference to the integer array (which is a humonguous object) into
    // the code cache.
    for(int i = 0; i < n; i++) {
        AA[i] = 0;
        BB[i] = 0;
    }
    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // deoptimize everyhing: this should make all compiled code zombies.
    WhiteBox wb = WhiteBox.getWhiteBox();
    wb.deoptimizeAll();

    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // wait a little for the code cache sweeper to try to clean up zombie nmethods
    // and unregister the code roots.
    try { Thread.sleep(5000); } catch (InterruptedException ex) { }

    // do some work on the arrays to make sure that they need to be live after the GCs
    for(int i = 0; i < n; i++) {
        AA[i] = 1;
        BB[i] = 10;
    }

    System.out.println();
}
 
Example 2
Source File: TestHumongousCodeCacheRoots.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) throws Exception {
    // do some work so that the compiler compiles this method, inlining the
    // reference to the integer array (which is a humonguous object) into
    // the code cache.
    for(int i = 0; i < n; i++) {
        AA[i] = 0;
        BB[i] = 0;
    }
    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // deoptimize everyhing: this should make all compiled code zombies.
    WhiteBox wb = WhiteBox.getWhiteBox();
    wb.deoptimizeAll();

    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // wait a little for the code cache sweeper to try to clean up zombie nmethods
    // and unregister the code roots.
    try { Thread.sleep(5000); } catch (InterruptedException ex) { }

    // do some work on the arrays to make sure that they need to be live after the GCs
    for(int i = 0; i < n; i++) {
        AA[i] = 1;
        BB[i] = 10;
    }

    System.out.println();
}
 
Example 3
Source File: TestHumongousCodeCacheRoots.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) throws Exception {
    // do some work so that the compiler compiles this method, inlining the
    // reference to the integer array (which is a humonguous object) into
    // the code cache.
    for(int i = 0; i < n; i++) {
        AA[i] = 0;
        BB[i] = 0;
    }
    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // deoptimize everyhing: this should make all compiled code zombies.
    WhiteBox wb = WhiteBox.getWhiteBox();
    wb.deoptimizeAll();

    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // wait a little for the code cache sweeper to try to clean up zombie nmethods
    // and unregister the code roots.
    try { Thread.sleep(5000); } catch (InterruptedException ex) { }

    // do some work on the arrays to make sure that they need to be live after the GCs
    for(int i = 0; i < n; i++) {
        AA[i] = 1;
        BB[i] = 10;
    }

    System.out.println();
}
 
Example 4
Source File: TestHumongousCodeCacheRoots.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) throws Exception {
    // do some work so that the compiler compiles this method, inlining the
    // reference to the integer array (which is a humonguous object) into
    // the code cache.
    for(int i = 0; i < n; i++) {
        AA[i] = 0;
        BB[i] = 0;
    }
    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // deoptimize everyhing: this should make all compiled code zombies.
    WhiteBox wb = WhiteBox.getWhiteBox();
    wb.deoptimizeAll();

    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // wait a little for the code cache sweeper to try to clean up zombie nmethods
    // and unregister the code roots.
    try { Thread.sleep(5000); } catch (InterruptedException ex) { }

    // do some work on the arrays to make sure that they need to be live after the GCs
    for(int i = 0; i < n; i++) {
        AA[i] = 1;
        BB[i] = 10;
    }

    System.out.println();
}
 
Example 5
Source File: TestHumongousCodeCacheRoots.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) throws Exception {
    // do some work so that the compiler compiles this method, inlining the
    // reference to the integer array (which is a humonguous object) into
    // the code cache.
    for(int i = 0; i < n; i++) {
        AA[i] = 0;
        BB[i] = 0;
    }
    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // deoptimize everyhing: this should make all compiled code zombies.
    WhiteBox wb = WhiteBox.getWhiteBox();
    wb.deoptimizeAll();

    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // wait a little for the code cache sweeper to try to clean up zombie nmethods
    // and unregister the code roots.
    try { Thread.sleep(5000); } catch (InterruptedException ex) { }

    // do some work on the arrays to make sure that they need to be live after the GCs
    for(int i = 0; i < n; i++) {
        AA[i] = 1;
        BB[i] = 10;
    }

    System.out.println();
}
 
Example 6
Source File: TestHumongousCodeCacheRoots.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) throws Exception {
    // do some work so that the compiler compiles this method, inlining the
    // reference to the integer array (which is a humonguous object) into
    // the code cache.
    for(int i = 0; i < n; i++) {
        AA[i] = 0;
        BB[i] = 0;
    }
    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // deoptimize everyhing: this should make all compiled code zombies.
    WhiteBox wb = WhiteBox.getWhiteBox();
    wb.deoptimizeAll();

    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // wait a little for the code cache sweeper to try to clean up zombie nmethods
    // and unregister the code roots.
    try { Thread.sleep(5000); } catch (InterruptedException ex) { }

    // do some work on the arrays to make sure that they need to be live after the GCs
    for(int i = 0; i < n; i++) {
        AA[i] = 1;
        BB[i] = 10;
    }

    System.out.println();
}
 
Example 7
Source File: TestHumongousCodeCacheRoots.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) throws Exception {
    // do some work so that the compiler compiles this method, inlining the
    // reference to the integer array (which is a humonguous object) into
    // the code cache.
    for(int i = 0; i < n; i++) {
        AA[i] = 0;
        BB[i] = 0;
    }
    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // deoptimize everyhing: this should make all compiled code zombies.
    WhiteBox wb = WhiteBox.getWhiteBox();
    wb.deoptimizeAll();

    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // wait a little for the code cache sweeper to try to clean up zombie nmethods
    // and unregister the code roots.
    try { Thread.sleep(5000); } catch (InterruptedException ex) { }

    // do some work on the arrays to make sure that they need to be live after the GCs
    for(int i = 0; i < n; i++) {
        AA[i] = 1;
        BB[i] = 10;
    }

    System.out.println();
}
 
Example 8
Source File: TestHumongousCodeCacheRoots.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) throws Exception {
    // do some work so that the compiler compiles this method, inlining the
    // reference to the integer array (which is a humonguous object) into
    // the code cache.
    for(int i = 0; i < n; i++) {
        AA[i] = 0;
        BB[i] = 0;
    }
    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // deoptimize everyhing: this should make all compiled code zombies.
    WhiteBox wb = WhiteBox.getWhiteBox();
    wb.deoptimizeAll();

    // trigger a GC that checks that the verification code allows humongous
    // objects with code cache roots; objects should be all live here.
    System.gc();

    // wait a little for the code cache sweeper to try to clean up zombie nmethods
    // and unregister the code roots.
    try { Thread.sleep(5000); } catch (InterruptedException ex) { }

    // do some work on the arrays to make sure that they need to be live after the GCs
    for(int i = 0; i < n; i++) {
        AA[i] = 1;
        BB[i] = 10;
    }

    System.out.println();
}