14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 4530538
27 * @summary Basic unit test of memory management testing:
28 * 1) setUsageThreshold() and getUsageThreshold()
29 * 2) test low memory detection on the old generation.
30 *
31 * @author Mandy Chung
32 *
33 * @library /lib/testlibrary/
34 * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
35 * @run main/timeout=600 LowMemoryTest
36 * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
37 * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
38 * @requires vm.opt.DisableExplicitGC != "true"
39 */
40
41 import java.lang.management.*;
42 import java.util.*;
43 import java.util.concurrent.Phaser;
44 import javax.management.*;
45 import javax.management.openmbean.CompositeData;
46
47 public class LowMemoryTest {
48 private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
49 private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
50 private static final Phaser phaser = new Phaser(2);
51 private static MemoryPoolMXBean mpool = null;
52 private static boolean trace = false;
53 private static boolean testFailed = false;
|
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 4530538
27 * @summary Basic unit test of memory management testing:
28 * 1) setUsageThreshold() and getUsageThreshold()
29 * 2) test low memory detection on the old generation.
30 *
31 * @author Mandy Chung
32 *
33 * @library /lib/testlibrary/
34 * @modules java.management
35 * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
36 * @run main/timeout=600 LowMemoryTest
37 * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
38 * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
39 * @requires vm.opt.DisableExplicitGC != "true"
40 */
41
42 import java.lang.management.*;
43 import java.util.*;
44 import java.util.concurrent.Phaser;
45 import javax.management.*;
46 import javax.management.openmbean.CompositeData;
47
48 public class LowMemoryTest {
49 private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
50 private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
51 private static final Phaser phaser = new Phaser(2);
52 private static MemoryPoolMXBean mpool = null;
53 private static boolean trace = false;
54 private static boolean testFailed = false;
|