< prev index next > test/hotspot/jtreg/vmTestbase/nsk/stress/jni/gclocker/gcl001.java
Print this page
* -stressThreadsFactor 8
*/
package nsk.stress.jni.gclocker;
+ import nsk.share.gc.DefaultProducer;
import nsk.share.gc.GC;
import nsk.share.gc.ThreadedGCTest;
import nsk.share.gc.gp.array.BooleanArrayProducer;
import nsk.share.gc.gp.array.ByteArrayProducer;
import nsk.share.gc.gp.array.CharArrayProducer;
class GarbageProducer implements Runnable {
private int maxSize;
ExecutionController stresser;
! ByteArrayProducer bp;
GarbageProducer(int size) {
this.maxSize = size;
! bp = new ByteArrayProducer();
}
public void run() {
if (stresser == null) {
stresser = getExecutionController();
}
while (stresser.continueExecution()) {
try {
! byte[] arr = bp.create(random(maxSize));
- tmp = arr;
} catch (OutOfMemoryError oome) {
// Do nothing.
}
}
}
class GarbageProducer implements Runnable {
private int maxSize;
ExecutionController stresser;
! DefaultProducer gp;
GarbageProducer(int size) {
this.maxSize = size;
! gp = new DefaultProducer();
}
public void run() {
if (stresser == null) {
stresser = getExecutionController();
}
while (stresser.continueExecution()) {
try {
! tmp = gp.create(random(maxSize));
} catch (OutOfMemoryError oome) {
// Do nothing.
}
}
}
< prev index next >