blob: 0edcd1f704fce3c0c73ad27bd9aca29e8bcf0b4d [file] [log] [blame]
<?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="task" />
<meta name="DC.title" content="Querying Heap Objects (OQL)" />
<meta name="DC.relation" scheme="URI" content="../reference/oqlsyntax.html" />
<meta name="copyright" content="Copyright (c) 2008, 2023 SAP AG, IBM Corporation and others. 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) 2008, 2023 SAP AG, IBM Corporation and others. 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="task_queryingheapobjects" />
<meta name="DC.language" content="en-us" />
<link rel="stylesheet" type="text/css" href="../styles/commonltr.css" />
<title>Querying Heap Objects (OQL)</title>
</head>
<body id="task_queryingheapobjects">
<h1 class="title topictitle1" id="ariaid-title1">Querying Heap Objects (OQL)</h1>
<div class="body taskbody">
<div class="section context">
<p class="p">Memory Analyzer allows to query the heap dump with custom
SQL-like queries. OQL represents classes as tables, objects as rows,
and fields as columns.</p>
<pre class="pre codeblock"><code>SELECT *
FROM [ INSTANCEOF ] &lt;class name="name"&gt;
[ WHERE &lt;filter-expression&gt; ]
&lt;/filter-expression&gt;&lt;/class&gt;</code></pre>
<p class="p">To open an OQL editor use the toolbar button <img class="image" src="../mimes/i-oqleditor.png" alt="open object query language button" />:</p>
<p class="p">OQL editor is divided into two areas:</p>
<ul class="ul"><li class="li">Text area to type in the query (upper area)</li>
<li class="li">Result area to display the result of the query execution</li>
</ul>
<img class="image" src="../mimes/m2fd32fba.png" alt="screen shot of query result" />
<p class="p">Use <span class="ph uicontrol">F5</span> or <span class="ph uicontrol">ctrl+enter</span> or toolbar button <img class="image" src="../mimes/4fd3f07a.png" alt="Execute Query button" /> to execute the query.</p>
<p class="p">Basic OQL syntax is as follows:</p>
<pre class="pre codeblock"><code>
SELECT *
FROM [ INSTANCEOF ] &lt;class name&gt;
[ WHERE &lt;filter-expression&gt; ]
</code></pre>
<p class="p">
The text area has autocompletion for class names, class name regular expressions,
field names, attributes and methods.
See <a class="xref" href="../reference/tipsandtricks.html#oqlcompletion">OQL autocompletion</a>.
</p>
<p class="p">
The navigation history shows previous OQL queries. Clicking on a previous query
executes it again. On many result panes, selecting some objects, then
<span class="ph menucascade"><span class="ph uicontrol">Copy</span><abbr title="and then"> &gt; </abbr><span class="ph uicontrol">OQL Query</span></span>
copies an OQL representation of the objects. This OQL can then be pasted
into the OQL editor text area.
This works from the OQL result area itself, and also copies the column details as well as the objects.
<img class="image" src="../mimes/oqlsaveresult.png" alt="screen shot of OQL navigation and copy OQL query" />
</p>
</div>
</div>
<div class="related-links">
<div class="linklist relinfo relref" xml:lang="en-us" lang="en-us"><strong>Related reference</strong><br />
<ul class="linklist">
<li class="linklist"><a class="link" href="../reference/oqlsyntax.html">OQL Syntax</a></li></ul></div>
</div>
</body>
</html>