author | jlahoda |
Wed, 12 Dec 2012 20:26:56 +0100 | |
changeset 14803 | 88347e495d34 |
parent 6125 | f919e72613e5 |
child 22602 | 0d9a07b0d7e9 |
permissions | -rw-r--r-- |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
1 |
#!/bin/sh |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
2 |
|
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
3 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
4 |
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
6 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
7 |
# This code is free software; you can redistribute it and/or modify it |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
9 |
# published by the Free Software Foundation. |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
10 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
15 |
# accompanied this code). |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
16 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
20 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
23 |
# questions. |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
24 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
25 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
26 |
# @test |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
27 |
# @bug 6942989 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
28 |
# @summary Check for WeakReference leak in Logger objects |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
29 |
# @author Daniel D. Daugherty |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
30 |
# |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
31 |
# @library ../../../sun/tools/common |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
32 |
# @build SimpleApplication ShutdownSimpleApplication |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
33 |
# @build LoggerWeakRefLeak |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
34 |
# @run shell/timeout=240 LoggerWeakRefLeak.sh |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
35 |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
36 |
# The timeout is: 2 minutes for infrastructure and 2 minutes for the test |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
37 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
38 |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
39 |
. ${TESTSRC}/../../../sun/tools/common/CommonSetup.sh |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
40 |
. ${TESTSRC}/../../../sun/tools/common/ApplicationSetup.sh |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
41 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
42 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
43 |
TEST_NAME="LoggerWeakRefLeak" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
44 |
TARGET_CLASS="java\.lang\.ref\.WeakReference" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
45 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
46 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
47 |
# MAIN begins here |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
48 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
49 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
50 |
seconds= |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
51 |
if [ "$#" -gt 0 ]; then |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
52 |
seconds="$1" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
53 |
fi |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
54 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
55 |
# see if this version of jmap supports the '-histo:live' option |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
56 |
jmap_option="-histo:live" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
57 |
set +e |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
58 |
"${JMAP}" 2>&1 | grep ':live' > /dev/null 2>&1 |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
59 |
status="$?" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
60 |
set -e |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
61 |
if [ "$status" != 0 ]; then |
6125
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
62 |
# usage message doesn't show ':live' option |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
63 |
|
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
64 |
if $isWindows; then |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
65 |
# If SA isn't present, then jmap gives a different usage message |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
66 |
# that doesn't show the ':live' option. However, that's a bug that |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
67 |
# is covered by 6971851 so we try using the option just to be sure. |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
68 |
# For some reason, this problem has only been seen on OpenJDK6 on |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
69 |
# Windows. Not sure why. |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
70 |
set +e |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
71 |
# Note: Don't copy this code to try probing process 0 on Linux; it |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
72 |
# will kill the process group in strange ways. |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
73 |
"${JMAP}" "$jmap_option" 0 2>&1 | grep 'Usage' > /dev/null 2>&1 |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
74 |
status="$?" |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
75 |
set -e |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
76 |
if [ "$status" = 0 ]; then |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
77 |
# Usage message generated so flag the problem. |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
78 |
status=1 |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
79 |
else |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
80 |
# No usage message so clear the flag. |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
81 |
status=0 |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
82 |
fi |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
83 |
fi |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
84 |
|
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
85 |
if [ "$status" != 0 ]; then |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
86 |
echo "ERROR: 'jmap $jmap_option' is not supported so this test" |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
87 |
echo "ERROR: cannot work reliably. Aborting!" |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
88 |
exit 2 |
f919e72613e5
6971847: 4/4 jmap '-histo:live' option is necessary for proper leak detection
dcubed
parents:
6120
diff
changeset
|
89 |
fi |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
90 |
fi |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
91 |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
92 |
# Start application and use TEST_NAME.port for coordination |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
93 |
startApplication "$TEST_NAME" "$TEST_NAME.port" $seconds |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
94 |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
95 |
finished_early=false |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
96 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
97 |
decreasing_cnt=0 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
98 |
increasing_cnt=0 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
99 |
loop_cnt=0 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
100 |
prev_instance_cnt=0 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
101 |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
102 |
MAX_JMAP_TRY_CNT=10 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
103 |
jmap_retry_cnt=0 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
104 |
loop_cnt_on_retry=0 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
105 |
|
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
106 |
while true; do |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
107 |
# see if the target process has finished its run and bail if it has |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
108 |
set +e |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
109 |
grep "^INFO: final loop count = " "$appOutput" > /dev/null 2>&1 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
110 |
status="$?" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
111 |
set -e |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
112 |
if [ "$status" = 0 ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
113 |
break |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
114 |
fi |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
115 |
|
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
116 |
# Output format for 'jmap -histo' in JDK1.5.0: |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
117 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
118 |
# <#bytes> <#instances> <class_name> |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
119 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
120 |
# Output format for 'jmap -histo:live': |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
121 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
122 |
# <num>: <#instances> <#bytes> <class_name> |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
123 |
# |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
124 |
set +e |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
125 |
"${JMAP}" "$jmap_option" "$appJavaPid" > "$TEST_NAME.jmap" 2>&1 |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
126 |
status="$?" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
127 |
set -e |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
128 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
129 |
if [ "$status" != 0 ]; then |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
130 |
echo "INFO: jmap exited with exit code = $status" |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
131 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
132 |
# There are intermittent jmap failures; see 6498448. |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
133 |
# |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
134 |
# So far the following have been observed in a jmap call |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
135 |
# that was not in a race with target process termination: |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
136 |
# |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
137 |
# (Solaris specific, 2nd sample) |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
138 |
# <pid>: Unable to open door: target process not responding or HotSpot VM not loaded |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
139 |
# The -F option can be used when the target process is not responding |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
140 |
# |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
141 |
# (on Solaris so far) |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
142 |
# java.io.IOException |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
143 |
# |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
144 |
# (on Solaris so far, 1st sample) |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
145 |
# <pid>: Permission denied |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
146 |
# |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
147 |
sed 's/^/INFO: /' "$TEST_NAME.jmap" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
148 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
149 |
if [ "$loop_cnt" = "$loop_cnt_on_retry" ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
150 |
# loop count hasn't changed |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
151 |
jmap_retry_cnt=`expr $jmap_retry_cnt + 1` |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
152 |
else |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
153 |
# loop count has changed so remember it |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
154 |
jmap_retry_cnt=1 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
155 |
loop_cnt_on_retry="$loop_cnt" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
156 |
fi |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
157 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
158 |
# This is '-ge' because we have the original attempt plus |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
159 |
# MAX_JMAP_TRY_CNT - 1 retries. |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
160 |
if [ "$jmap_retry_cnt" -ge "$MAX_JMAP_TRY_CNT" ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
161 |
echo "INFO: jmap failed $MAX_JMAP_TRY_CNT times in a row" \ |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
162 |
"without making any progress." |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
163 |
echo "FAIL: jmap is unable to take any samples." >&2 |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
164 |
killApplication |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
165 |
exit 2 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
166 |
fi |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
167 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
168 |
# short delay and try again |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
169 |
# Note: sleep 1 didn't help with "<pid>: Permission denied" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
170 |
sleep 2 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
171 |
echo "INFO: retrying jmap (retry=$jmap_retry_cnt, loop=$loop_cnt)." |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
172 |
continue |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
173 |
fi |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
174 |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
175 |
set +e |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
176 |
instance_cnt=`grep "${PATTERN_WS}${TARGET_CLASS}${PATTERN_EOL}" \ |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
177 |
"$TEST_NAME.jmap" \ |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
178 |
| sed ' |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
179 |
# strip leading whitespace; does nothing in JDK1.5.0 |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
180 |
s/^'"${PATTERN_WS}${PATTERN_WS}"'*// |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
181 |
# strip <#bytes> in JDK1.5.0; does nothing otherwise |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
182 |
s/^[1-9][0-9]*'"${PATTERN_WS}${PATTERN_WS}"'*// |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
183 |
# strip <num>: field; does nothing in JDK1.5.0 |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
184 |
s/^[1-9][0-9]*:'"${PATTERN_WS}${PATTERN_WS}"'*// |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
185 |
# strip <class_name> field |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
186 |
s/'"${PATTERN_WS}"'.*// |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
187 |
'` |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
188 |
set -e |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
189 |
if [ -z "$instance_cnt" ]; then |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
190 |
echo "INFO: instance count is unexpectedly empty" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
191 |
if [ "$loop_cnt" = 0 ]; then |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
192 |
echo "INFO: on the first iteration so no sample was found." |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
193 |
echo "INFO: There is likely a problem with the sed filter." |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
194 |
echo "INFO: start of jmap output:" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
195 |
cat "$TEST_NAME.jmap" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
196 |
echo "INFO: end of jmap output." |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
197 |
echo "FAIL: cannot find the instance count value." >&2 |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
198 |
killApplication |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
199 |
exit 2 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
200 |
fi |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
201 |
else |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
202 |
echo "INFO: instance_cnt = $instance_cnt" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
203 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
204 |
if [ "$instance_cnt" -gt "$prev_instance_cnt" ]; then |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
205 |
increasing_cnt=`expr $increasing_cnt + 1` |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
206 |
else |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
207 |
# actually decreasing or the same |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
208 |
decreasing_cnt=`expr $decreasing_cnt + 1` |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
209 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
210 |
# For these particular WeakReference leaks, the count was |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
211 |
# always observed to be increasing so if we get a decreasing |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
212 |
# or the same count, then the leaks are fixed in the bits |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
213 |
# being tested. |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
214 |
echo "INFO: finishing early due to non-increasing instance count." |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
215 |
finished_early=true |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
216 |
killApplication |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
217 |
break |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
218 |
fi |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
219 |
prev_instance_cnt="$instance_cnt" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
220 |
fi |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
221 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
222 |
# delay between samples |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
223 |
sleep 5 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
224 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
225 |
loop_cnt=`expr $loop_cnt + 1` |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
226 |
done |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
227 |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
228 |
if [ $finished_early = false ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
229 |
stopApplication "$TEST_NAME.port" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
230 |
waitForApplication |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
231 |
fi |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
232 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
233 |
echo "INFO: $TEST_NAME has finished running." |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
234 |
echo "INFO: increasing_cnt = $increasing_cnt" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
235 |
echo "INFO: decreasing_cnt = $decreasing_cnt" |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
236 |
if [ "$jmap_retry_cnt" -gt 0 ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
237 |
echo "INFO: jmap_retry_cnt = $jmap_retry_cnt (in $loop_cnt iterations)" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
238 |
fi |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
239 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
240 |
if [ "$loop_cnt" = 0 ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
241 |
echo "FAIL: jmap is unable to take any samples." >&2 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
242 |
exit 2 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
243 |
fi |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
244 |
|
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
245 |
echo "INFO: The instance count of" `eval echo $TARGET_CLASS` "objects" |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
246 |
if [ "$decreasing_cnt" = 0 ]; then |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
247 |
echo "INFO: is always increasing." |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
248 |
echo "FAIL: This indicates that there is a memory leak." >&2 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
249 |
exit 2 |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
250 |
fi |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
251 |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
6006
diff
changeset
|
252 |
echo "INFO: is not always increasing." |
5964
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
253 |
echo "PASS: This indicates that there is not a memory leak." |
0496aa46ae9f
6942989: 2/2 Memory leak of java.lang.ref.WeakReference objects
dcubed
parents:
diff
changeset
|
254 |
exit 0 |