8149778: serviceability/tmtools/jstat/GcCapacityTest.java causes JVM to hang during GC

Reviewed-by: pliden, stefank
This commit is contained in:
Robbin Ehn 2016-06-15 09:43:42 +02:00
parent 2d7e2d242f
commit f5b4d9e51f
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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;