Online Help

JLeak is a java agent, which is a feature released with the JVM 1.5. As such, when starting your application, an external "agent" can bring modification to the code in a dynamic way to introduce instrumentation.

JLeak agent uses javassist to modify the bytecode of all the classes being loaded by the JVM in order to be notified by every instanciation and finalization.

It does NOT work with any of the class loaded by the SystemClassLoader, hence all JVM classes such as "String" are not checked.

To run your application with jleak enabled, you just have to add the following JVM parameters to your application:
-javaagent:C:\\ path to jleak archive \\jleak.jar

Running your application this way will open the monitor dialog within the same process as your application. Doing so is fine for standalone applications using a full GUI, but it will not for application servers when deployed on a guiless host.

To run jleak with a remote monitor dialog, add the following JVM parameters to your application:
-javaagent:C:\\ path to jleak archive \\jleak.jar=host:port

where host:port is the host where the dialog monitor is launched remotely

ex: -javaagent:C:\\ path to jleak archive \\jleak.jar=192.168.10.10:9909

To launch the agent dialog monitor separately, just double click on the "jleak.jar" jar file, which is auto executable. Of course, this will only work if the ".jar" extension is configured to be opened by default by the JVM. If this is not the case, right click on the jar file and select "open with..." and select your current JVM.

The default listening port for the dialog monitor is 9909, but it can be changed by giving a parameter to a command line used to launch the monitor.

Example from within the folder where jleak.jar is located:

java -cp jleak.jar com.qarks.leakdetector.ui.LeakDetectorFrame 9901