The profiler API allows you to control profiling programmatically. Also, in your automatic memory tests you can open saved memory snapshots and examine them via the set description language.
To control profiling programmatically, also consider command line tool which in some cases may be a simpler approach.
Please find API JavaDoc here
allows you to profile (i.e. turn on and off profiling modes and capture snapshots)
the application itself or another Java application.
To use this part of the API, please include <Profiler Installation Directory>/lib/yjp-controller-api-redist.jar in the classpath.
support the analysis of captured memory snapshots and snapshot annotation.
To use this part of the API, please include <Profiler Installation Directory>/lib/yjp.jar in the classpath.
The code that uses the API should run on Java 5 or newer.
Important: Do not remove
yjp.jar from the installation directory.
The API will not work with
yjp.jar moved to an arbitrary directory,
because it needs the other files from the installation.