test/hotspot/jtreg/vmTestbase/heapdump/JMapHeap/run.sh
author iignatyev
Tue, 15 May 2018 11:28:29 -0700
changeset 50112 7a2a740815b7
permissions -rw-r--r--
8202392: [TESTBUG] open source vm testbase heapdump tests Reviewed-by: sspitsyn, mseledtsov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50112
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     1
#!/bin/sh
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     2
# Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     4
#
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     7
# published by the Free Software Foundation.
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     8
#
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    13
# accompanied this code).
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    14
#
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    18
#
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    21
# questions.
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    22
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    23
. $TESTSRC/../share/common.sh
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    24
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    25
JAVA_OPTS="${JAVA_OPTS} -XX:-UseGCOverheadLimit -Xmx1G"
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    26
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    27
DUMPFILE=heap.bin
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    28
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    29
rm -f ${DUMPFILE}
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    30
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    31
JMAP_DUMP_OPT="-dump:format=b,file=${DUMPFILE}"
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    32
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    33
${JAVA} ${JAVA_OPTS} heapdump.share.EatMemory -exec "${JMAP} ${JMAP_DUMP_OPT} %p"
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    34
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    35
status=$?
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    36
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    37
if [ $status -ne 0 ]; then
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    38
        fail "Java exited with exit status: $status"
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    39
fi
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    40
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    41
if [ ! -f "${DUMPFILE}" ]; then
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    42
        fail "Dump file was not created: $DUMPFILE"
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    43
fi
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    44
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    45
verify_heapdump ${DUMPFILE}
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    46
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    47
if [ $? -ne 0 ]; then
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    48
        fail "Verification of heap dump failed"
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    49
fi
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    50
7a2a740815b7 8202392: [TESTBUG] open source vm testbase heapdump tests
iignatyev
parents:
diff changeset
    51
pass