Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8208207: Test nsk/stress/jni/gclocker/gcl001 fails after co-location

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@

/**
* @test TestSoftReferencesBehaviorOnOOME
* @key gc
* @key gc randomness
* @summary Tests that all SoftReferences has been cleared at time of OOM.
* @requires vm.gc != "Z"
* @library /test/lib
@@ -25,9 +25,10 @@

/**
* @test TestByteArrays
* @key gc
* @key gc randomness
* @requires vm.gc.Epsilon & !vm.graal.enabled
* @summary Epsilon is able to allocate arrays, and does not corrupt their state
* @library /test/lib
*
* @run main/othervm -XX:+UseTLAB -Xmx256m
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
@@ -69,16 +70,15 @@
*/

import java.util.Random;
import jdk.test.lib.Utils;

public class TestByteArrays {

static long SEED = Long.getLong("seed", System.nanoTime());
static int COUNT = Integer.getInteger("count", 500); // ~100 MB allocation

static byte[][] arr;

public static void main(String[] args) throws Exception {
Random r = new Random(SEED);
Random r = Utils.getRandomInstance();

arr = new byte[COUNT * 100][];
for (int c = 0; c < COUNT; c++) {
@@ -88,7 +88,7 @@ public static void main(String[] args) throws Exception {
}
}

r = new Random(SEED);
r = new Random(Utils.SEED);
for (int c = 0; c < COUNT; c++) {
byte[] b = arr[c];
if (b.length != (c * 100)) {
@@ -25,9 +25,10 @@

/**
* @test TestElasticTLAB
* @key gc
* @key gc randomness
* @requires vm.gc.Epsilon & !vm.graal.enabled
* @summary Epsilon is able to work with/without elastic TLABs
* @library /test/lib
*
* @run main/othervm -Xmx256m
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
@@ -56,16 +57,16 @@
*/

import java.util.Random;
import jdk.test.lib.Utils;

public class TestElasticTLAB {

static long SEED = Long.getLong("seed", System.nanoTime());
static int COUNT = Integer.getInteger("count", 500); // ~100 MB allocation

static byte[][] arr;

public static void main(String[] args) throws Exception {
Random r = new Random(SEED);
Random r = Utils.getRandomInstance();

arr = new byte[COUNT * 100][];
for (int c = 0; c < COUNT; c++) {
@@ -75,7 +76,7 @@ public static void main(String[] args) throws Exception {
}
}

r = new Random(SEED);
r = new Random(Utils.SEED);
for (int c = 0; c < COUNT; c++) {
byte[] b = arr[c];
if (b.length != (c * 100)) {
@@ -25,9 +25,10 @@

/**
* @test TestElasticTLABDecay
* @key gc
* @key gc randomness
* @requires vm.gc.Epsilon & !vm.graal.enabled
* @summary Epsilon is able to work with/without elastic TLABs
* @library /test/lib
*
* @run main/othervm -Xmx256m
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
@@ -46,16 +47,15 @@
*/

import java.util.Random;
import jdk.test.lib.Utils;

public class TestElasticTLABDecay {

static long SEED = Long.getLong("seed", System.nanoTime());
static int COUNT = Integer.getInteger("count", 500); // ~100 MB allocation

static byte[][] arr;

public static void main(String[] args) throws Exception {
Random r = new Random(SEED);
Random r = Utils.getRandomInstance();

arr = new byte[COUNT * 100][];
for (int c = 0; c < COUNT; c++) {
@@ -66,7 +66,7 @@ public static void main(String[] args) throws Exception {
Thread.sleep(5);
}

r = new Random(SEED);
r = new Random(Utils.SEED);
for (int c = 0; c < COUNT; c++) {
byte[] b = arr[c];
if (b.length != (c * 100)) {
@@ -25,9 +25,10 @@

/**
* @test TestObjects
* @key gc
* @key gc randomness
* @requires vm.gc.Epsilon & !vm.graal.enabled
* @summary Epsilon is able to allocate objects, and does not corrupt their state
* @library /test/lib
*
* @run main/othervm -XX:+UseTLAB -Xmx256m
* -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC
@@ -69,23 +70,22 @@
*/

import java.util.Random;
import jdk.test.lib.Utils;

public class TestObjects {

static long SEED = Long.getLong("seed", System.nanoTime());
static int COUNT = Integer.getInteger("count", 1_000_000); // ~24 MB allocation

static MyObject[] arr;

public static void main(String[] args) throws Exception {
Random r = new Random(SEED);
Random r = Utils.getRandomInstance();

arr = new MyObject[COUNT];
for (int c = 0; c < COUNT; c++) {
arr[c] = new MyObject(r.nextInt());
}

r = new Random(SEED);
r = new Random(Utils.SEED);
for (int c = 0; c < COUNT; c++) {
int expected = r.nextInt();
int actual = arr[c].id();
@@ -25,7 +25,7 @@

/**
* @test TestRefArrays
* @key gc
* @key gc randomness
* @requires vm.gc.Epsilon & !vm.graal.enabled
* @summary Epsilon is able to allocate arrays, and does not corrupt their state
* @library /test/lib
@@ -70,16 +70,15 @@
*/

import java.util.Random;
import jdk.test.lib.Utils;

public class TestRefArrays {

static long SEED = Long.getLong("seed", System.nanoTime());
static int COUNT = Integer.getInteger("count", 200); // ~100 MB allocation

static MyObject[][] arr;

public static void main(String[] args) throws Exception {
Random r = new Random(SEED);
Random r = Utils.getRandomInstance();

arr = new MyObject[COUNT * 100][];
for (int c = 0; c < COUNT; c++) {
@@ -89,7 +88,7 @@ public static void main(String[] args) throws Exception {
}
}

r = new Random(SEED);
r = new Random(Utils.SEED);
for (int c = 0; c < COUNT; c++) {
MyObject[] b = arr[c];
if (b.length != (c * 100)) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
* @bug 8051973
* @summary Test to make sure that eager reclaim of humongous objects correctly clears
* mark bitmaps at reclaim.
* @key gc
* @key gc randomness
* @requires vm.gc.G1
* @library /test/lib
* @modules java.base/jdk.internal.misc
@@ -42,6 +42,7 @@

import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.Utils;

// An object that has a few references to other instances to slow down marking.
class ObjectWithSomeRefs {
@@ -75,7 +76,7 @@ public static void main(String[] args) {
longList.add(new ObjectWithSomeRefs());
}

Random rnd = new Random();
Random rnd = Utils.getRandomInstance();
for (int i = 0; i < longList.size(); i++) {
int len = longList.size();
longList.get(i).other1 = longList.get(rnd.nextInt(len));
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@

import jdk.test.lib.Asserts;
import jdk.test.lib.Platform;
import jdk.test.lib.Utils;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.Utils;
@@ -40,10 +41,12 @@
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import jdk.internal.misc.Unsafe; // for ADDRESS_SIZE
import sun.hotspot.WhiteBox;

public class TestShrinkAuxiliaryData {
private static final Random RNG = Utils.getRandomInstance();

private static final int REGION_SIZE = 1024 * 1024;

@@ -215,7 +218,7 @@ public void addRef(GarbageObject g) {

public void mutate() {
if (!payload.isEmpty() && payload.get(0).length > 0) {
payload.get(0)[0] = (byte) (Math.random() * Byte.MAX_VALUE);
payload.get(0)[0] = (byte) (RNG.nextDouble() * Byte.MAX_VALUE);
}
}
}
@@ -296,12 +299,12 @@ private void link() {
for (int i = 0; i < NUM_LINKS; i++) {
int regionToLink;
do {
regionToLink = (int) (Math.random() * REGIONS_TO_ALLOCATE);
regionToLink = (int) (RNG.nextDouble() * REGIONS_TO_ALLOCATE);
} while (regionToLink == regionNumber);

// get random garbage object from random region
garbage.get(ig).addRef(garbage.get(regionToLink
* NUM_OBJECTS_PER_REGION + (int) (Math.random()
* NUM_OBJECTS_PER_REGION + (int) (RNG.nextDouble()
* NUM_OBJECTS_PER_REGION)));
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@

/**
* @test TestShrinkAuxiliaryData00
* @key randomness
* @bug 8038423 8061715
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@

/**
* @test TestShrinkAuxiliaryData05
* @key randomness
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@

/**
* @test TestShrinkAuxiliaryData10
* @key randomness
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
/**
* @test TestShrinkAuxiliaryData15
* @bug 8038423 8061715 8078405
* @key randomness
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
* @requires vm.gc.G1
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@

/**
* @test TestShrinkAuxiliaryData20
* @key randomness
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@

/**
* @test TestShrinkAuxiliaryData25
* @key randomness
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values