Profiling Petals ESB with Eclipse TPTP

Hi,

For those who do not understand the title, this article might help.
Since it took me almost 3 hours to make it work I decided to post some king of tutorial to explain how I proceeded.
This blog
was very helpful, even it was only half of the path.

I here explain the main lines. I don’t detail all the possibilities.

Installing everything

I assume you already installed Petals ESB (Petals 3.0, platform edition).
Go at http://www.eclipse.org/tptp/home/downloads/ to download TPTP All-in-One.

This stand-alone Eclipse application will be the one used to get the profiling information.
Unzip it. Change the memory settings of the application: open Eclipse.ini and upgrade -Xmx to 512.

From the same address, download the Stand Alone Agent Controllers.
Unzip this archive on the disk, and define an environment variable TPTP_AC_HOME which points to the root folder.
If it helps you, in the Petals debug script, TPTP_AC_HOME/plugins is referenced.

Then, run TPTP_AC_HOME/bin/SetConfig.bat (or .sh). It should result in the creation of the file TPTP_AC_HOME/config/serviceconfig.xml.

Eventually, FYI, I slightly changed the PETALS_HOME/bin/debug.bat (.sh) script.
I modified it so that %PROFILE_OPTS% does not contain any quote character (you can just display the command to be sure).
However, I do not know if it was really necessary.

Launching and connecting everything

Since I got troubles with this, I strongly advise you to terminate all the Java processes before running the TPTP profiler.
Run the TPTP_AC_HOME/bin/ACServer script or application.

Then, start Petals with the profiling options PETALS_HOME/bin/debug.bat -P -M memory
These options mean you are profiling (-P) Petals with Eclipse (we could use NetBeans) and that you are watching object allocations.
The available options are specified in the Petals debug script.

Eventually, start the TPTP Eclipse application.

The Petals debug script makes the profiling work in enabled mode. It means it is activated when Eclipse connects to the profiler agent.
To create this connection, follow these steps:

  1. Go into Run > Profile Configurations…
  2. Right-click Attach to Agent and click New.
  3. Give a name to the new configuration, and add it a new port on the localhost (10006).
  4. Select this second port and go into the Agents tab.
  5. Wait few seconds and select the agent that was set by the Petals debug script.
  6. Select Apply and then Profile.

The main profiling tab

The Agent tab in Eclipse TPTP

If an error occurs, you can check the ACServer log.
It is called servicelog.log and located under TPTP_AC_HOME/config.

Profiling…

It’s profiling with 3 dots, as it is not as simple as I expected.
In fact, it is very slow with Petals. I even run into an out-of-memory exception.
This is why I mentionned the memory settings should be upgraded.
I will have to make other tries, as I spent less than 15 minutes to use the profiler.

But the biggest part is already done.


About this entry