-
Notifications
You must be signed in to change notification settings - Fork 3
/
query_report.html
306 lines (251 loc) · 14.5 KB
/
query_report.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="DITA-OT" /><meta name="DC.type" content="reference" />
<meta name="DC.title" content="Query Report" />
<meta name="abstract" content="Run a single query to produce a report in batch mode." />
<meta name="description" content="Run a single query to produce a report in batch mode." />
<meta name="prodname" content="Eclipse Memory Analyzer" />
<meta name="version" content="1" />
<meta name="release" content="11" />
<meta name="modification" content="0" />
<meta name="platform" content="Windows" />
<meta name="platform" content="Linux" />
<meta name="platform" content="macOS" />
<meta name="copyright" content="Copyright (c) 2020,2023 IBM Corporation. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/ " type="primary" />
<meta name="DC.rights.owner" content="Copyright (c) 2020,2023 IBM Corporation. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/ " type="primary" />
<meta name="DC.format" content="XHTML" />
<meta name="DC.identifier" content="ref_inspections_query_report" />
<meta name="DC.language" content="en-us" />
<link rel="stylesheet" type="text/css" href="../../styles/commonltr.css" />
<title>Query Report</title>
</head>
<body id="ref_inspections_query_report">
<h1 class="title topictitle1" id="ariaid-title1">Query Report</h1>
<div class="body refbody"><p class="shortdesc">Run a single query to produce a report in batch mode.
</p>
<div class="section"><h2 class="title sectiontitle">Motivation</h2>
<p class="p">Sometime it is useful to run a single query on a heap dump when in
batch mode. This could be because it is known in advance what needs
to be
run, or the heap dump needs to remain on a big machine with no easily
available graphical user interface.
</p>
</div>
<div class="section"><h2 class="title sectiontitle">Arguments</h2>
<table cellpadding="4" cellspacing="0" summary="" border="1" class="simpletable"><col style="width:50%" /><col style="width:50%" /><thead><tr class="sthead">
<th style="vertical-align:bottom;text-align:left;" id="d5952e68" class="stentry">Argument</th>
<th style="vertical-align:bottom;text-align:left;" id="d5952e71" class="stentry">Description</th>
</tr>
</thead><tbody><tr class="strow">
<td style="vertical-align:top;" headers="d5952e68" class="stentry">-command</td>
<td style="vertical-align:top;" headers="d5952e71" class="stentry">The command line version of the query to be run. This
is like the text typed into the <a class="xref" href="../selectingqueries.html">'Search Queries' query browser</a> command line.
</td>
</tr>
<tr class="strow">
<td style="vertical-align:top;" headers="d5952e68" class="stentry">other report options</td>
<td style="vertical-align:top;" headers="d5952e71" class="stentry">See <a class="xref" href="../../tasks/batch.html#task_batch__report_options">batch mode control of report options</a></td>
</tr>
</tbody></table>
</div>
<div class="section" id="ref_inspections_query_report__result"><h2 class="title sectiontitle">Result</h2>
<p class="p">A report holding the result of the query (by default, in HTML).</p>
</div>
<div class="example"><h2 class="title sectiontitle">Simple example of a histogram for Windows</h2>
<p class="p">
<code class="ph codeph">
<span class="ph filepath"><span class="keyword cmdname">.\mat\ParseHeapDump.bat</span></span>
<span class="ph filepath">myheapdump.hprof</span>
<span class="keyword option">-command=</span><span class="keyword cmdname">histogram</span>
<span class="keyword parmname">org.eclipse.mat.api:query</span>
</code>
</p>
</div>
<div class="example"><h2 class="title sectiontitle">Simple example of a histogram for Linux or macOS</h2>
<p class="p">
<code class="ph codeph">
<span class="ph filepath"><span class="keyword cmdname">./mat/ParseHeapDump.sh</span></span>
<var class="keyword varname">myheapdump.hprof</var>
<span class="keyword option">-command=</span><span class="keyword cmdname">histogram</span>
<span class="keyword parmname">org.eclipse.mat.api:query</span>
</code>
</p>
</div>
<div class="example"><h2 class="title sectiontitle">Simple example of a histogram in text format and unzipped (*_Query\pages\Query_Command2.txt) for Windows</h2>
<p class="p">
<code class="ph codeph">
<span class="ph filepath"><span class="keyword cmdname">.\mat\ParseHeapDump.bat</span></span>
<span class="ph filepath">myheapdump.hprof</span>
<span class="keyword option">-command=</span><span class="keyword cmdname">histogram</span>
<span class="keyword option">-format=</span><span class="keyword cmdname">txt</span>
<span class="keyword option">-unzip</span>
<span class="keyword parmname">org.eclipse.mat.api:query</span>
</code>
</p>
</div>
<div class="example"><h2 class="title sectiontitle">Simple example of a histogram in text format and unzipped (*_Query/pages/Query_Command2.txt) for Linux or macOS</h2>
<p class="p">
<code class="ph codeph">
<span class="ph filepath"><span class="keyword cmdname">./mat/ParseHeapDump.sh</span></span>
<var class="keyword varname">myheapdump.hprof</var>
<span class="keyword option">-command=</span><span class="keyword cmdname">histogram</span>
<span class="keyword option">-format=</span><span class="keyword cmdname">txt</span>
<span class="keyword option">-unzip</span>
<span class="keyword parmname">org.eclipse.mat.api:query</span>
</code>
</p>
</div>
<div class="example"><h2 class="title sectiontitle">Simple OQL example for Windows</h2>
<div class="p">
<code class="ph codeph">
<span class="ph filepath"><span class="keyword cmdname">.\mat\ParseHeapDump.bat</span></span>
<span class="ph filepath">myheapdump.hprof</span>
<span class="ph synph"><span class="ph delim">"</span></span><span class="keyword option">-command=</span><span class="keyword cmdname">oql</span> <var class="keyword varname">\\\"SELECT * FROM java.lang.String s\\\"</var><span class="ph synph"><span class="ph delim">"</span></span>
<span class="keyword parmname">org.eclipse.mat.api:query</span>
</code>
<div class="note"><span class="notetitle">Note:</span> The OQL query <span class="keyword cmdname">oql</span> has the actual OQL statement surrounded by
double quotes. These need to be escaped here as shown.
The whole of the command option must be passed to Eclipse Memory Analyzer as a single argument
starting with <span class="keyword option">-command</span>. As the query command has spaces the
whole argument is surrounded by double quotes so the operating system
treats it as a single item.</div>
</div>
</div>
<div class="example"><h2 class="title sectiontitle">Simple OQL example for Linux or macOS</h2>
<div class="p">
<code class="ph codeph">
<span class="ph filepath"><span class="keyword cmdname">./mat/ParseHeapDump.sh</span></span>
<span class="ph filepath">myheapdump.hprof</span>
<span class="ph synph"><span class="ph delim">"</span></span><span class="keyword option">-command=</span><span class="keyword cmdname">oql</span> <var class="keyword varname">\"SELECT * FROM java.lang.String s\"</var><span class="ph synph"><span class="ph delim">"</span></span>
<span class="keyword parmname">org.eclipse.mat.api:query</span>
</code>
<div class="note"><span class="notetitle">Note:</span> The OQL query <span class="keyword cmdname">oql</span> has the actual OQL statement surrounded by
double quotes. These need to be escaped here as shown.
The whole of the command option must be passed to Eclipse Memory Analyzer as a single argument
starting with <span class="keyword option">-command</span>. As the query command has spaces the
whole argument is surrounded by double quotes so the operating system
treats it as a single item.</div>
</div>
</div>
<div class="example"><h2 class="title sectiontitle">Another OQL example for Windows</h2>
<div class="p">
<code class="ph codeph">
<span class="ph filepath"><span class="keyword cmdname">.\mat\ParseHeapDump.bat</span></span>
<span class="ph filepath">myheapdump.hprof</span>
<span class="ph synph"><span class="ph delim">"</span></span><span class="keyword option">-command=</span><span class="keyword cmdname">oql</span> <var class="keyword varname">\\\"SELECT s AS Object, toString(s) AS \\\\\\\"String value\\\\\\\" FROM \\\\\\\"java.lang.String.*\\\\\\\" s WHERE toString(s) LIKE \\\\\\\".*\\..*\\\\\\\" AND s.hash ^^^> 0\\\"</var><span class="ph synph"><span class="ph delim">"</span></span>
<span class="keyword parmname">org.eclipse.mat.api:query</span>
</code>
<pre class="pre msgblock">
Task: Reopening parsed heap dump file
[.........]
Subtask: Query
[
Subtask: Test 'Query command' of section 'Query'
[
Subtask: SELECT s AS Object, toString(s) AS "String value" FROM "java.lang.String.*" s WHERE ((toString(s) LIKE ".*\..*") and (s.hash > 0))
[
Subtask: Collecting objects of classes
[
Subtask: Checking class java.lang.StringConcatHelper
[
Subtask: Checking class java.lang.String[][]
[
Subtask: Checking class java.lang.StringLatin1
[
Subtask: Checking class java.lang.StringCoding$Result
[
Subtask: Checking class java.lang.StringBuilder
[
Subtask: Checking class java.lang.String$CaseInsensitiveComparator
[
Subtask: Checking class java.lang.StringCoding$1
[
Subtask: Checking class java.lang.String[]
[
Subtask: Checking class java.lang.StringCoding
[
Subtask: Checking class java.lang.String
[
</pre>
<div class="note"><span class="notetitle">Note:</span> The OQL query <span class="keyword cmdname">oql</span> has the actual OQL statement surrounded by
double quotes. These need to be escaped here as shown.
The whole of the command option must be passed to Eclipse Memory Analyzer as a single argument
starting with <span class="keyword option">-command</span>. As the query command has spaces the
whole argument is surrounded by double quotes so the operating system
treats it as a single item.
Any double quotes in the OQL statement need 7 backslashes before.
The greater-than sign > needs to be escaped with 3 carets ^^^ as it appears
to be outside of double-quotes to the Windows command line interpreter and so
would be misinterpreted as a redirect.
A backslash in the OQL statement needs to be doubled.
There are no character escapes in OQL string literals.
It is not therefore possible to add a double quote to a <span class="keyword cmdname">SELECT</span>
<span class="keyword cmdname">AS</span> column name. It makes no sense to add it to a
class pattern for a <span class="keyword cmdname">FROM</span> item.
It is not possible to add a double quote to a <span class="keyword cmdname">LIKE</span>
regular expression string literal. It would be possible to use the <code class="ph codeph">matches()</code>
method and build the pattern using a string concatenation using character quote holding a double quote.
</div>
</div>
</div>
<div class="example"><h2 class="title sectiontitle">Another OQL example for Linux or macOS</h2>
<div class="p">
<code class="ph codeph">
<span class="ph filepath"><span class="keyword cmdname">./mat/ParseHeapDump.sh</span></span>
<span class="ph filepath">myheapdump.hprof</span>
<span class="ph synph"><span class="ph delim">"</span></span><span class="keyword option">-command=</span><span class="keyword cmdname">oql</span> <var class="keyword varname">\"select s as \\\"a b\\\" from \\\"java.lang.String.*\\\" WHERE toString(s) LIKE \\\".*\\\..*\\\" AND s.hash > 0\"</var><span class="ph synph"><span class="ph delim">"</span></span>
<span class="keyword parmname">org.eclipse.mat.api:query</span>
</code>
<pre class="pre msgblock">
Task: Reopening parsed heap dump file
[.........]
Subtask: Single Query
[
Subtask: Test 'Query Command' of section 'Single Query'
[
Subtask: SELECT s AS Object, toString(s) AS "String value" FROM "java.lang.String.*" s WHERE ((toString(s) LIKE ".*\..*") and (s.hash > 0))
[
Subtask: Collecting objects of classes
[
Subtask: Checking class java.lang.String[]
[
Subtask: Checking class java.lang.String[][]
[
Subtask: Checking class java.lang.String$CaseInsensitiveComparator
[
Subtask: Checking class java.lang.StringCoding$StringEncoder
[
Subtask: Checking class java.lang.StringCoding
[
Subtask: Checking class java.lang.StringBuffer
[
Subtask: Checking class java.lang.StringBuilder
[
Subtask: Checking class java.lang.String
[
Subtask: Checking class java.lang.StringCoding$StringDecoder
</pre>
<div class="note"><span class="notetitle">Note:</span> The OQL query <span class="keyword cmdname">oql</span> has the actual OQL statement surrounded by
double quotes. These need to be escaped here as shown.
The whole of the command option must be passed to Eclipse Memory Analyzer as a single argument
starting with <span class="keyword option">-command</span>. As the query command has spaces the
whole argument is surrounded by double quotes so the operating system
treats it as a single item.
Any double quotes in the OQL statement need 3 backslashes before.
A backslash in the OQL statement needs to be doubled.
There are no character escapes in OQL string literals.
It is not therefore possible to add a double quote to a <span class="keyword cmdname">SELECT</span>
<span class="keyword cmdname">AS</span> column name. It makes no sense to add it to a
class pattern for a <span class="keyword cmdname">FROM</span> item.
It is not possible to add a double quote to a <span class="keyword cmdname">LIKE</span>
regular expression string literal. It would be possible to use the <code class="ph codeph">matches()</code>
method and build the pattern using a string concatenation using character quote holding a double quote.
</div>
</div>
</div>
</div>
</body>
</html>