hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java
author ctornqvi
Fri, 19 Aug 2016 10:06:30 -0400
changeset 40631 ed82623d7831
parent 38089 9e58203ef0e2
permissions -rw-r--r--
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder Reviewed-by: coleenp, gtriantafill, mseledtsov, iignatyev, dholmes, dsamersoff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
     1
/*
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 38089
diff changeset
     2
 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
     4
 *
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
     7
 * published by the Free Software Foundation.
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
     8
 *
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    13
 * accompanied this code).
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    14
 *
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    18
 *
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    21
 * questions.
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    22
 */
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    23
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    24
/*
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    25
 * @test
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    26
 * @summary Test reserve/commit/uncommit/release of virtual memory and that we track it correctly
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    27
 * @key nmt jcmd
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 38089
diff changeset
    28
 * @library /test/lib
36851
03e2f4d0a421 8153737: Unsupported Module
chegar
parents: 33730
diff changeset
    29
 * @modules java.base/jdk.internal.misc
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 29574
diff changeset
    30
 *          java.management
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 38089
diff changeset
    31
 * @build sun.hotspot.WhiteBox
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    32
 * @run main ClassFileInstaller sun.hotspot.WhiteBox
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    33
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocCommitUncommitRecommit
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    34
 *
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    35
 */
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    36
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 38089
diff changeset
    37
import jdk.test.lib.process.ProcessTools;
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 38089
diff changeset
    38
import jdk.test.lib.process.OutputAnalyzer;
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 38089
diff changeset
    39
import jdk.test.lib.JDKToolFinder;
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    40
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    41
import sun.hotspot.WhiteBox;
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    42
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    43
public class VirtualAllocCommitUncommitRecommit {
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    44
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    45
    public static WhiteBox wb = WhiteBox.getWhiteBox();
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    46
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    47
    public static void main(String args[]) throws Exception {
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    48
        OutputAnalyzer output;
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
    49
        long commitSize = 128 * 1024; // 128KB
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
    50
        long reserveSize = 4 * 1024 * 1024; // 4096KB
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    51
        long addr;
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    52
38089
9e58203ef0e2 8153992: Some hotspot tests fail on compact2 due to an unnecessary test library dependency
akulyakh
parents: 36851
diff changeset
    53
        String pid = Long.toString(ProcessTools.getProcessId());
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    54
        ProcessBuilder pb = new ProcessBuilder();
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    55
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    56
        // reserve
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    57
        addr = wb.NMTReserveMemory(reserveSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    58
        pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid,
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    59
                "VM.native_memory", "detail" });
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    60
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    61
        output = new OutputAnalyzer(pb.start());
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
    62
        output.shouldContain("Test (reserved=4096KB, committed=0KB)");
29574
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    63
        output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    64
                           + Long.toHexString(addr + reserveSize)
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    65
                           + "\\] reserved 4096KB for Test");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    66
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    67
        long addrA = addr;
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    68
        long addrB = addr + commitSize;
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    69
        long addrC = addr + (2 * commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    70
        long addrD = addr + (3 * commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    71
        long addrE = addr + (4 * commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    72
        long addrF = addr + (5 * commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    73
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    74
        // commit ABCD
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    75
        wb.NMTCommitMemory(addrA, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    76
        wb.NMTCommitMemory(addrB, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    77
        wb.NMTCommitMemory(addrC, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    78
        wb.NMTCommitMemory(addrD, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    79
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    80
        output = new OutputAnalyzer(pb.start());
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
    81
        output.shouldContain("Test (reserved=4096KB, committed=512KB)");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    82
29574
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    83
        output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    84
                           + Long.toHexString(addr + reserveSize)
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    85
                           + "\\] reserved 4096KB for Test");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    86
        // uncommit BC
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    87
        wb.NMTUncommitMemory(addrB, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    88
        wb.NMTUncommitMemory(addrC, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    89
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    90
        output = new OutputAnalyzer(pb.start());
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
    91
        output.shouldContain("Test (reserved=4096KB, committed=256KB)");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    92
29574
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    93
        output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    94
                            + Long.toHexString(addr + reserveSize)
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
    95
                            + "\\] reserved 4096KB for Test");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    96
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    97
        // commit EF
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    98
        wb.NMTCommitMemory(addrE, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
    99
        wb.NMTCommitMemory(addrF, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   100
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   101
        output = new OutputAnalyzer(pb.start());
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
   102
        output.shouldContain("Test (reserved=4096KB, committed=512KB)");
29574
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   103
        output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   104
                           + Long.toHexString(addr + reserveSize)
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   105
                           + "\\] reserved 4096KB for Test");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   106
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   107
        // uncommit A
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   108
        wb.NMTUncommitMemory(addrA, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   109
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   110
        output = new OutputAnalyzer(pb.start());
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
   111
        output.shouldContain("Test (reserved=4096KB, committed=384KB)");
29574
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   112
        output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   113
                           + Long.toHexString(addr + reserveSize)
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   114
                           + "\\] reserved 4096KB for Test");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   115
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   116
        // commit ABC
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   117
        wb.NMTCommitMemory(addrA, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   118
        wb.NMTCommitMemory(addrB, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   119
        wb.NMTCommitMemory(addrC, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   120
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   121
        output = new OutputAnalyzer(pb.start());
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
   122
        output.shouldContain("Test (reserved=4096KB, committed=768KB)");
29574
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   123
        output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   124
                           + Long.toHexString(addr + reserveSize)
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   125
                           + "\\] reserved 4096KB for Test");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   126
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   127
        // uncommit ABCDEF
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   128
        wb.NMTUncommitMemory(addrA, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   129
        wb.NMTUncommitMemory(addrB, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   130
        wb.NMTUncommitMemory(addrC, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   131
        wb.NMTUncommitMemory(addrD, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   132
        wb.NMTUncommitMemory(addrE, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   133
        wb.NMTUncommitMemory(addrF, commitSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   134
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   135
        output = new OutputAnalyzer(pb.start());
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
   136
        output.shouldContain("Test (reserved=4096KB, committed=0KB)");
29574
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   137
        output.shouldMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   138
                           + Long.toHexString(addr + reserveSize)
ab0121071f54 8069111: Investigate NMT detail tracking support for 32bit ARM
cjplummer
parents: 28190
diff changeset
   139
                           + "\\] reserved 4096KB for Test");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   140
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   141
        // release
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   142
        wb.NMTReleaseMemory(addr, reserveSize);
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   143
        output = new OutputAnalyzer(pb.start());
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   144
        output.shouldNotContain("Test (reserved=");
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   145
        output.shouldNotMatch("\\[0x[0]*" + Long.toHexString(addr) + " - 0x[0]*"
26303
ef9b4c475c1d 8055844: [TESTBUG] test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java fails on Solaris Sparc due to incorrect page size being used
ctornqvi
parents: 26300
diff changeset
   146
                + Long.toHexString(addr + reserveSize) + "\\] reserved 4096KB for Test");
25952
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   147
    }
25c2dca04a31 8054952: [TESTBUG] Add missing NMT2 tests
gtriantafill
parents:
diff changeset
   148
}