Terrasoft ProfilerJTerrasoft ProfilerJ
Home | Features | Screenshots | Documentation | Download | Evaluate | Buy | Contact | About
ProfilerJ
Agent
Snapshot file format
ProfilerJ Console
Command line reference
Installation
Content of distribution
Installation
Tutorial
Step 1 - Download files
Step 2 - Deploy agent
Step 3 - Run ProfilerJ Console
Step 4 - Get a license key
Step 5 - Run ProfilerJ Viewer
Step 6 - Sampling
Step 7 - Byte Code Instrumentation
Step 8 - Code Coverage
ProfilerJ Viewer

Step 7 - Byte Code Instrumentation

This section demonstrates how to gather detailed profile information using BCI.

Define classes to instrument

Start ProfilerJ-Viewer and select "Settings / Sampling and Instrumentation rules". Switch to tab "Profile" and include com.terrasoft.profilerj.*. Note that this is a regular expression!

Be sure that checkbox "Enabled" is selected.

Apply instrumentation

Start Example01.bat now and press in order establish a connection between the viewer and the agent. Select "Remote VM / Apply instrumentation rules" and resume Example01 by clicking by clicking " Resume Process" 

 

Create a snapshot

To create a snapshot select menu item " Create snapshot". The snapshot will be automatically displayed. Select tab "Profiler" and you should see something like this:

The method runLoop(int) (called methods excluded!) consumes 15 seconds. The overhead (see table below tree  view) is 0 ms. This means that the CPU-time consumed by the ProfilerJ-agent itself is negligible. On the other hand, the cumulated values show a different picture. The overhead here is 7.9 seconds or 66% of the measured 23.8 seconds. In reality (i.e. without byte code instrumentation), the method with all its called methods would have consumed (23.8 - 7.9) seconds.

Show hotspots

The hotspot view lists all methods sorted by CPU-time consumption. Right-click the topmost entry of the tree (named "snapshot ....) and select "  Hotspots". Subsequently, a new tab named "Hotspots" appears:

 

«previous  next »

Copyright © 2006 Terrasoft Software GmbH. All rights reserved.