Ariadna Heap Analysis Tool

Ariadna is a tool for analyzing memory leaks. It consists of a low-overhead JVMTI agent for taking a heap snapshot and an analysis tool. It is similar to HAT but its has an almost zero overhead agent and its analyzer should also load faster. It collects less information though.

Requirements

JDK 5 for Debugee as well as Analysis Tool.

Downloading

The latest version can be downloaded here.

Building the agent

The agent is a one file ANSI C and needs to be compiled against the JVMTI headers into a shared object file. A binary build for Windows is available. You are welcome to contribute Unix builds, too.

Generating a heap dump

Run your leaking program with -agentlib:ariadna, where ariadna.[dll/so] is in your library path. Alternatively, use -agentpath:/your/path/to/ariadna.so. You can trigger a heap dump via CTRL-Break (windows) or CTRL-\ / SIGQUIT (Unix). Alternatively, you can include ariadna.jar into your application's classpath and call the static method org.mernst.ariadna.agent.Agent.dump(). Two files are written in the program's working directory: "heap" and "classes.txt".

Analyzing a heap dump

Change to the directory where the dump files are. Run 'java -jar /path/to/ariadna.jar'. An http server will start on port 9999. Point a browser to 'http://localhost:9999/'. You will be redirected to the class listing.

Class Listing

/classes/[filter] will list all classes whose name contains the filter, or all if no filter is given, along with the number of instances and the total size. You can navigate to the instance listing of each class.

Instance Listing

/instances/[classid] will list all instances of that class. You can navigate to the instance information of each instance.

Instance Listing

/instance/[classid] will find the shortest reference chain that keeps this instance alive.

Acknowledgements

Ariadna consists of code from Sun's J2SE demo code and uses Jetty 5.0 for running the analysis server. Kudos to the authors.

Matthias Ernst <matthias.ernst@coremedia.com>