Mercurial > hg > truffle
annotate test/runtime/NMT/ChangeTrackingLevel.java @ 21864:e44b10693a44
Added tag jdk8u45-b11 for changeset f4822d122041
author | asaha |
---|---|
date | Mon, 09 Mar 2015 12:35:33 -0700 |
parents | 417e3b8d04c5 |
children |
rev | line source |
---|---|
20553
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
1 /* |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
4 * |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
8 * |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
13 * accompanied this code). |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
14 * |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
18 * |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
21 * questions. |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
22 */ |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
23 |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
24 /* |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
25 * @test |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
26 * @bug 8059100 |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
27 * @summary Test that you can decrease NMT tracking level but not increase it. |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
28 * @key nmt |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
29 * @library /testlibrary /testlibrary/whitebox |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
30 * @build ChangeTrackingLevel |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
31 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
32 * sun.hotspot.WhiteBox$WhiteBoxPermission |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ChangeTrackingLevel |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
34 */ |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
35 |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
36 import com.oracle.java.testlibrary.*; |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
37 import sun.hotspot.WhiteBox; |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
38 |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
39 public class ChangeTrackingLevel { |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
40 |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
41 public static WhiteBox wb = WhiteBox.getWhiteBox(); |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
42 public static void main(String args[]) throws Exception { |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
43 boolean testChangeLevel = wb.NMTChangeTrackingLevel(); |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
44 if (testChangeLevel) { |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
45 System.out.println("NMT level change test passed."); |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
46 } else { |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
47 // it also fails if the VM asserts. |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
48 throw new RuntimeException("NMT level change test failed"); |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
49 } |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
50 } |
417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents:
diff
changeset
|
51 }; |