Xojo Instruments − Runtime Diagnostic Tool for Xojo Desktop Apps
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Build Automation.xojo_code


Xojo Instruments

Xojo Instruments is a runtime tool to diagnose memory leaks and circular references in Xojo Desktop applications.


Quick Start

  1. Download the latest release from Releases.
  2. Open Xojo Instruments project in Xojo IDE.
  3. Copy XojoInstruments folder to your project using the IDE.
  4. Insert the following line to App.Open event handler of your project.

Basic Usage

Snapshot Capturing

  1. Run your application.
  2. Click Capture in Xojo Instruments window to capture the current runtime status.
  3. Do something in your application.
  4. Click Capture & Compare.
  5. Go to Comparison tab to see what objects has been added/removed.

While running your application under the IDE, you can also view the selected object in IDE by clicking Inspect in IDE.

Reference Graph

Reference Graph represents a dependency (reference hierarchy) between objects. You can possibly find circular reference by using the graph.

  1. Turn on Build Reference Graph and click Capture.
  2. Go to Visualization tab.
  3. Click Render. Note that dot command (GraphViz; brew install graphviz to install on macOS) is required.

While running your application under the IDE, you can view the object in IDE by clicking a object node in the graph.

You can also use Backreference tab to see back reference (list of objects referring the target object).


  • As Xojo framework itself creates/caches some instances, you may notice unexpected "leaks" of instances. Common ones are EndOfLine and Xojo.Introspection.*.
  • Reference graphs are built by traversing properties of each object. Please be aware that due to the limitation of introspection mechanism, Xojo Instruments cannot capture all references. Here is an example of references that cannot be captured:
    • Delegates (e.g., reference created by AddHandler)
    • Module properties
    • Shared class properties
    • Static variables
    • Reference between window and non-control instances / container controls
    • Some objects used by Xojo framework itself
  • When comparing any two snapshots, you will at least see 1 added & 1 removed Delegate instance. This is a known limitation.


MIT License