mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
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
2 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue