Java Code Examples for com.oracle.java.testlibrary.Platform#is32bit()

The following examples show how to use com.oracle.java.testlibrary.Platform#is32bit() . 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: TestShrinkAuxiliaryData.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void test() throws Exception {
    ArrayList<String> vmOpts = new ArrayList();
    Collections.addAll(vmOpts, initialOpts);

    int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
    if (maxCacheSize < hotCardTableSize) {
        System.out.format("Skiping test for %d cache size due max cache size %d",
                hotCardTableSize, maxCacheSize
        );
        return;
    }

    printTestInfo(maxCacheSize);

    vmOpts.add("-XX:G1ConcRSLogCacheSize=" + hotCardTableSize);
    vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));

    // for 32 bits ObjectAlignmentInBytes is not a option
    if (Platform.is32bit()) {
        ArrayList<String> vmOptsWithoutAlign = new ArrayList(vmOpts);
        vmOptsWithoutAlign.add(ShrinkAuxiliaryDataTest.class.getName());
        performTest(vmOptsWithoutAlign);
        return;
    }

    for (int alignment = 3; alignment <= 8; alignment++) {
        ArrayList<String> vmOptsWithAlign = new ArrayList(vmOpts);
        vmOptsWithAlign.add("-XX:ObjectAlignmentInBytes="
                + (int) Math.pow(2, alignment));
        vmOptsWithAlign.add(ShrinkAuxiliaryDataTest.class.getName());

        performTest(vmOptsWithAlign);
    }
}
 
Example 2
Source File: TestCapacityUntilGCWrapAround.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    if (Platform.is32bit()) {
        WhiteBox wb = WhiteBox.getWhiteBox();

        long before = wb.metaspaceCapacityUntilGC();
        // Now force possible overflow of capacity_until_GC.
        long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);

        Asserts.assertGTE(after, before,
                          "Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
        Asserts.assertLTE(after, MAX_UINT,
                          "Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
    }
}
 
Example 3
Source File: TestShrinkAuxiliaryData.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected void test() throws Exception {
    ArrayList<String> vmOpts = new ArrayList();
    Collections.addAll(vmOpts, initialOpts);

    int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
    if (maxCacheSize < hotCardTableSize) {
        System.out.format("Skiping test for %d cache size due max cache size %d",
                hotCardTableSize, maxCacheSize
        );
        return;
    }

    printTestInfo(maxCacheSize);

    vmOpts.add("-XX:G1ConcRSLogCacheSize=" + hotCardTableSize);
    vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));

    // for 32 bits ObjectAlignmentInBytes is not a option
    if (Platform.is32bit()) {
        ArrayList<String> vmOptsWithoutAlign = new ArrayList(vmOpts);
        vmOptsWithoutAlign.add(ShrinkAuxiliaryDataTest.class.getName());
        performTest(vmOptsWithoutAlign);
        return;
    }

    for (int alignment = 3; alignment <= 8; alignment++) {
        ArrayList<String> vmOptsWithAlign = new ArrayList(vmOpts);
        vmOptsWithAlign.add("-XX:ObjectAlignmentInBytes="
                + (int) Math.pow(2, alignment));
        vmOptsWithAlign.add(ShrinkAuxiliaryDataTest.class.getName());

        performTest(vmOptsWithAlign);
    }
}
 
Example 4
Source File: TestCapacityUntilGCWrapAround.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    if (Platform.is32bit()) {
        WhiteBox wb = WhiteBox.getWhiteBox();

        long before = wb.metaspaceCapacityUntilGC();
        // Now force possible overflow of capacity_until_GC.
        long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);

        Asserts.assertGTE(after, before,
                          "Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
        Asserts.assertLTE(after, MAX_UINT,
                          "Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
    }
}
 
Example 5
Source File: TestShrinkAuxiliaryData.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void test() throws Exception {
    ArrayList<String> vmOpts = new ArrayList();
    Collections.addAll(vmOpts, initialOpts);

    int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
    if (maxCacheSize < hotCardTableSize) {
        System.out.format("Skiping test for %d cache size due max cache size %d",
                hotCardTableSize, maxCacheSize
        );
        return;
    }

    printTestInfo(maxCacheSize);

    vmOpts.add("-XX:G1ConcRSLogCacheSize=" + hotCardTableSize);
    vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));

    // for 32 bits ObjectAlignmentInBytes is not a option
    if (Platform.is32bit()) {
        ArrayList<String> vmOptsWithoutAlign = new ArrayList(vmOpts);
        vmOptsWithoutAlign.add(ShrinkAuxiliaryDataTest.class.getName());
        performTest(vmOptsWithoutAlign);
        return;
    }

    for (int alignment = 3; alignment <= 8; alignment++) {
        ArrayList<String> vmOptsWithAlign = new ArrayList(vmOpts);
        vmOptsWithAlign.add("-XX:ObjectAlignmentInBytes="
                + (int) Math.pow(2, alignment));
        vmOptsWithAlign.add(ShrinkAuxiliaryDataTest.class.getName());

        performTest(vmOptsWithAlign);
    }
}
 
Example 6
Source File: TestCapacityUntilGCWrapAround.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    if (Platform.is32bit()) {
        WhiteBox wb = WhiteBox.getWhiteBox();

        long before = wb.metaspaceCapacityUntilGC();
        // Now force possible overflow of capacity_until_GC.
        long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);

        Asserts.assertGTE(after, before,
                          "Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
        Asserts.assertLTE(after, MAX_UINT,
                          "Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
    }
}
 
Example 7
Source File: TestShrinkAuxiliaryData.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void test() throws Exception {
    ArrayList<String> vmOpts = new ArrayList();
    Collections.addAll(vmOpts, initialOpts);

    int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
    if (maxCacheSize < hotCardTableSize) {
        System.out.format("Skiping test for %d cache size due max cache size %d",
                hotCardTableSize, maxCacheSize
        );
        return;
    }

    printTestInfo(maxCacheSize);

    vmOpts.add("-XX:G1ConcRSLogCacheSize=" + hotCardTableSize);
    vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));

    // for 32 bits ObjectAlignmentInBytes is not a option
    if (Platform.is32bit()) {
        ArrayList<String> vmOptsWithoutAlign = new ArrayList(vmOpts);
        vmOptsWithoutAlign.add(ShrinkAuxiliaryDataTest.class.getName());
        performTest(vmOptsWithoutAlign);
        return;
    }

    for (int alignment = 3; alignment <= 8; alignment++) {
        ArrayList<String> vmOptsWithAlign = new ArrayList(vmOpts);
        vmOptsWithAlign.add("-XX:ObjectAlignmentInBytes="
                + (int) Math.pow(2, alignment));
        vmOptsWithAlign.add(ShrinkAuxiliaryDataTest.class.getName());

        performTest(vmOptsWithAlign);
    }
}
 
Example 8
Source File: TestCapacityUntilGCWrapAround.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    if (Platform.is32bit()) {
        WhiteBox wb = WhiteBox.getWhiteBox();

        long before = wb.metaspaceCapacityUntilGC();
        // Now force possible overflow of capacity_until_GC.
        long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);

        Asserts.assertGTE(after, before,
                          "Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
        Asserts.assertLTE(after, MAX_UINT,
                          "Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
    }
}
 
Example 9
Source File: TestShrinkAuxiliaryData.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void test() throws Exception {
    ArrayList<String> vmOpts = new ArrayList();
    Collections.addAll(vmOpts, initialOpts);

    int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
    if (maxCacheSize < hotCardTableSize) {
        System.out.format("Skiping test for %d cache size due max cache size %d",
                hotCardTableSize, maxCacheSize
        );
        return;
    }

    printTestInfo(maxCacheSize);

    vmOpts.add("-XX:G1ConcRSLogCacheSize=" + hotCardTableSize);
    vmOpts.addAll(Arrays.asList(Utils.getTestJavaOpts()));

    // for 32 bits ObjectAlignmentInBytes is not a option
    if (Platform.is32bit()) {
        ArrayList<String> vmOptsWithoutAlign = new ArrayList(vmOpts);
        vmOptsWithoutAlign.add(ShrinkAuxiliaryDataTest.class.getName());
        performTest(vmOptsWithoutAlign);
        return;
    }

    for (int alignment = 3; alignment <= 8; alignment++) {
        ArrayList<String> vmOptsWithAlign = new ArrayList(vmOpts);
        vmOptsWithAlign.add("-XX:ObjectAlignmentInBytes="
                + (int) Math.pow(2, alignment));
        vmOptsWithAlign.add(ShrinkAuxiliaryDataTest.class.getName());

        performTest(vmOptsWithAlign);
    }
}
 
Example 10
Source File: TestCapacityUntilGCWrapAround.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    if (Platform.is32bit()) {
        WhiteBox wb = WhiteBox.getWhiteBox();

        long before = wb.metaspaceCapacityUntilGC();
        // Now force possible overflow of capacity_until_GC.
        long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);

        Asserts.assertGTE(after, before,
                          "Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
        Asserts.assertLTE(after, MAX_UINT,
                          "Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
    }
}