comparison test/runtime/NMT/ReleaseCommittedMemory.java @ 20361:ac12996df59b

8044140: Create NMT (Native Memory Tracking) tests for NMT2 Summary: Create new/modify existing tests for NMT2, which is an internal redesign to address scalability issues in the first implementation. Reviewed-by: ctornqvi, zgu Contributed-by: George Triantafillou <george.triantafillou@oracle.com>
author zgu
date Wed, 27 Aug 2014 08:35:03 -0400
parents c18152e0554e
children 6640f982c1be
comparison
equal deleted inserted replaced
20360:833b0f92429a 20361:ac12996df59b
1 /* 1 /*
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
26 * @bug 8013120 26 * @bug 8013120
27 * @summary Release committed memory and make sure NMT handles it correctly 27 * @summary Release committed memory and make sure NMT handles it correctly
28 * @key nmt regression 28 * @key nmt regression
29 * @library /testlibrary /testlibrary/whitebox 29 * @library /testlibrary /testlibrary/whitebox
30 * @build ReleaseCommittedMemory 30 * @build ReleaseCommittedMemory
31 * @ignore
31 * @run main ClassFileInstaller sun.hotspot.WhiteBox 32 * @run main ClassFileInstaller sun.hotspot.WhiteBox
32 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ReleaseCommittedMemory 33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ReleaseCommittedMemory
33 */ 34 */
34 35
35 import sun.hotspot.WhiteBox; 36 import sun.hotspot.WhiteBox;
42 long addr; 43 long addr;
43 44
44 addr = wb.NMTReserveMemory(reserveSize); 45 addr = wb.NMTReserveMemory(reserveSize);
45 wb.NMTCommitMemory(addr, 128*1024); 46 wb.NMTCommitMemory(addr, 128*1024);
46 wb.NMTReleaseMemory(addr, reserveSize); 47 wb.NMTReleaseMemory(addr, reserveSize);
47 wb.NMTWaitForDataMerge();
48 } 48 }
49 } 49 }
50 50