You can run mBProfiler headless – i.e. without its Eclipse plugin frontend. The generated profiling data can be automatically saved to XML, text or binary format and later analysed (e.g. in Eclipse with the help of the mBProfiler frontend if using the binary format).
Starting mBProfiler headless is useful, for instance, if you want to track down the performance of an application from one version to another. For this purpose, you can start mBProfiler without its frontend automatically each time the application is run. Moreover, you can take advantage of the Profiler API to invoke profiling actions during the application's execution.
Launching a Headless Session
To start mBProfiler headless:
#<property> = <value_1> | <value_2> | <value_n>
To activate a property, remove the # token in front of it, set a value by choosing the one that you need and removing the others.
For example, to set the transport type to socket, the transport property line should be
transport=socket
Profiling Settings
This table describes the properties from headless_config.ini that you can use to configure the headless profiling session to a remote Java application.
Property Name |
Description |
|---|---|
transport |
The transport type in use. Its value can be:
|
address |
The host and the port of the profiled application. This property value should be provided as <application_host>:<port>. For example, localhost:5115. |
depth |
The depth of call stack traces for memory profiling. |
memAutoStart |
If true, autostart a memory profiling session on mBProfiler startup. |
cpuAutoStart |
If true, autostart a CPU profiling session on mBProfiler startup. |
vmAutoStart |
If true, autostart a VM telemetry session on mBProfiler startup. |
threadsAutoStart |
If true, autostart a threads profiling session on mBProfiler startup. |
keepTemps |
If true, save the temporary objects during the session (they are usually cleaned by the JVM's garbage collector) to check if the application is producing too many such objects. |
cpuMode |
The CPU profiling method in use. Its value can be:
|
cpuClock |
Additional CPU profiling settings. This property can have one of the following values:
|
cpuInterval |
Depending on the CPU profiling method in use (specified through the cpuMode property):
|
saveOn |
The moment to save the collected information in the format indicated by the saveAs property. Can have one of the following values:
The data will be saved into the current directory, that is, into dropins/mBProfiler/eclipse/plugins/com.prosyst.profiler_6.2.0 or into plugins/com.prosyst.profiler_6.2.0. |
saveAs |
The format in which the profiling data will be saved if saveOn is equal to exit. Can have one of the following values:
|
saveTraces |
If true, mBProfiler will save the full stack traces of profiled applications. For the XML format this option will be applied on CPU, memory and heap profiling, for the text one – on CPU profiling. |
saveHotSpots |
If true, mBProfiler will also save profiling information on memory hot spots in the generated report. |