DeleakerConsole.exe
DeleakerConsole.exe is a command-line tool designed to automate snapshot creation and leak report exporting. It is intended for use in CI pipelines and other automated workflows to detect memory and resource leaks in applications.
The tool is installed in the Deleaker installation directory. By default, DeleakerConsole.exe is available at one of the following paths:
- %ProgramFiles(x86)%\Deleaker\DeleakerConsole.exe
- %ProgramFiles%\Deleaker\DeleakerConsole.exe
Syntax
DeleakerConsole.exe [options] parameters
Options
| Option | Description |
|---|---|
| --export-xml-report-on-exit reportPath | Optional. If specified, DeleakerConsole.exe generates an XML leak report when the monitored process exits. reportPath must be a file path, not a directory. |
| --snapshot-database snapshotDatabasePath | Required if --save-snapshot-on-exit or --save-snapshot-period is specified. Specifies the file where snapshots (.dsnapshot, readable by the Deleaker UI) are stored. |
| --snapshot-name snapshotName | Optional. Specifies the name of the snapshot created on process exit. Use together with --save-snapshot-on-exit or --export-xml-report-on-exit. |
| --save-snapshot-on-exit | Optional. If specified, a snapshot is saved when the process exits. Requires --snapshot-database. |
| --save-snapshot-period periodSeconds | Optional. If specified, snapshots are saved periodically every periodSeconds seconds. Requires --snapshot-database. |
| --crash-dump-directory crashDumpsDirectory | Optional. If specified, a crash dump is written to crashDumpsDirectory if the process crashes. This value must be a directory path, not a file. |
| --process-working-directory processWorkingDirectory | Optional. Specifies the working directory for the launched process. |
Parameters
| Parameter | Description |
|---|---|
| --run exePath [arguments] | Required. Starts the process located at exePath with optional command-line arguments. IMPORTANT: This parameter must be placed at the end of the command line. Everything after --run is treated as the command line of the launched process. |
Remarks
The --run exePath [arguments] parameter must always appear at the end of the command line.
Consider the following command:
DeleakerConsole.exe --run C:\Repo\App\trunk\bin\App.exe /someOption --export-xml-report-on-exit exit_report.xml
It may appear that DeleakerConsole.exe will start the application and then export a report. In reality, everything after --run is treated as arguments for the launched process. As a result, no report is generated and the launched process receives the following command line:
C:\Repo\App\trunk\bin\App.exe /someOption --export-xml-report-on-exit exit_report.xml
The correct command line is:
DeleakerConsole.exe --export-xml-report-on-exit exit_report.xml --crash-dump-directory . --run C:\Repo\App\trunk\bin\App.exe /someOption
Examples
Example 1
DeleakerConsole.exe --export-xml-report-on-exit exit_report.xml --crash-dump-directory . --run C:\Repo\App\trunk\bin\App.exe /someOption
Runs C:\Repo\App\trunk\bin\App.exe /someOption.
If the process crashes, a dump file is saved to the current directory. When the process exits normally, an XML leak report is written to exit_report.xml.
Example 2
DeleakerConsole.exe --save-snapshot-on-exit --snapshot-database leaks.dsnapshot --run C:\Repo\App\trunk\bin\App.exe /someOption
Runs C:\Repo\App\trunk\bin\App.exe /someOption.
When the process exits, a snapshot is saved to leaks.dsnapshot.
Example 3
DeleakerConsole.exe --save-snapshot-period 3 --snapshot-database leaks.dsnapshot --run C:\Repo\App\trunk\bin\App.exe /someOption
Runs C:\Repo\App\trunk\bin\App.exe /someOption.
A new snapshot is saved every 3 seconds to leaks.dsnapshot.