View complex objects using IBM Memory Analyzer — Cognos Extension

After installed MAT from the link I mentioned in the previous post, you have opened a Java system dump.

The first thing you might run into is an object. You wonder what the purpose of the object is. The primitive objects such as string, sockets are easy to understand. Simply expanding an object and its children node, and you get what you want to see.

What about complex objects, for example, dom4j object, JSON objects. These are popular objects used by most modern applications.
Expanding the nodes of these objects is very time-consuming and impossible to understand, illustrated in figure 1.

Figure 1, a raw dom4j objects

With the Cognos extension, displaying a dom4j in XML is easy. Highlight a dom4j object, select the query. The resulting window is a tree structured XML navigation pane. Please refer to figure 2, figure 3.

Figure 2 — run Display XML query against a dom4j object
Figure 3. A xml tree is displayed. It turns out the object is a string table

What about large XML objects? There are a few options to tweak the query. See the following options.

The default query behavior is to find the root document and display the whole document even when you selected a child element. You can select showfromdocumentrool = false, so the output only displays the current node and its children.

The second and the third options are used to limit the output size.

If show_xml_tree = false, the output is a simple string, you can copy into another XML formatter to do addition search, sort etc.

It is possible to save output into a file for very large object. You can load the file into a database or DOM parser to do more advanced analysis — which I do sometimes.

JSON object works the same way, and the data container objects work similarly.

This is the start of the content-oriented analysis approach/journey — which is based on the data. Relieving from looking at the complex data structure, so the analyst can focus on the system behavior via the system operational view. The goal is to answer fundamental questions such as what, who, and for how long the issue/symptom has existed.

George is with IBM Cognos. He developed the content-oriented analysis methodology. His interesting is software performance and none-reproducible issues.