8280553: resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java can fail if GC occurs
Reviewed-by: alanb, amenkov
This commit is contained in:
parent
268880b471
commit
be9f984cae
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -23,9 +23,12 @@
|
|||||||
|
|
||||||
import jdk.test.lib.apps.LingeredApp;
|
import jdk.test.lib.apps.LingeredApp;
|
||||||
|
|
||||||
|
import java.lang.ref.Reference;
|
||||||
|
|
||||||
public class LingeredAppWithLargeArray extends LingeredApp {
|
public class LingeredAppWithLargeArray extends LingeredApp {
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
int[] hugeArray = new int[Integer.MAX_VALUE/2];
|
int[] hugeArray = new int[Integer.MAX_VALUE/2];
|
||||||
LingeredApp.main(args);
|
LingeredApp.main(args);
|
||||||
|
Reference.reachabilityFence(hugeArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user