blob: 2349694fd2a1885fa2c312edc5b25d282682ac52 [file]
<?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 xml:lang="en-us" lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<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, 2010 SAP AG and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html " type="primary"/>
<meta name="DC.Rights.Owner" content="Copyright (c) 2008, 2010 SAP AG and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html " 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">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">SELECT *
FROM [ INSTANCEOF ] &lt;class name="name"&gt;
[ WHERE &lt;filter-expression&gt; ]
&lt;/filter-expression&gt;&lt;/class&gt;</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 F5 or Ctrl-Enter 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">
SELECT *
FROM [ INSTANCEOF ] &lt;class name&gt;
[ WHERE &lt;filter-expression&gt; ]
</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> &gt; <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="relinfo relref"><strong>Related reference</strong><br/>
<div><a class="link" href="../reference/oqlsyntax.html">OQL Syntax</a></div>
</div>
</div>
</body>
</html>