8149778: serviceability/tmtools/jstat/GcCapacityTest.java causes JVM to hang during GC
Reviewed-by: pliden, stefank
This commit is contained in:
parent
2d7e2d242f
commit
f5b4d9e51f
@ -33,7 +33,6 @@ import utils.*;
|
||||
* @requires vm.opt.ExplicitGCInvokesConcurrent != true
|
||||
* @build common.*
|
||||
* @build utils.*
|
||||
* @ignore 8149778
|
||||
* @run main/othervm -XX:+UsePerfData -Xmx128M GcCapacityTest
|
||||
*/
|
||||
public class GcCapacityTest {
|
||||
|
@ -42,8 +42,9 @@ public class GcProvokerImpl implements GcProvoker {
|
||||
// uses fixed small objects to avoid Humongous objects allocation in G1
|
||||
int memoryChunk = 2048;
|
||||
List<Object> list = new ArrayList<>();
|
||||
float used = 0;
|
||||
while (used < targetUsage * maxMemory) {
|
||||
long used = 0;
|
||||
long target = (long) (maxMemory * targetUsage);
|
||||
while (used < target) {
|
||||
try {
|
||||
list.add(new byte[memoryChunk]);
|
||||
used += memoryChunk;
|
||||
|
Loading…
Reference in New Issue
Block a user