Identifying active threads

Active threads within a program can be easily identified using the Execution Flow view of the Profiling Tool. Using the Execution Flow view will allow you to examine the threads within a program and quickly identify when and where most of a program's resources are spent. Prerequisites:

To open the Execution Flow view follow these steps:

  1. In the Profiling Monitor view, select a resource under a profile project, for example a monitor or an agent.

  2. Right click, then select Open With > Execution Flow. The Execution Flow view opens.

  3. In the Execution Flow view, each thread consists of a large number of method calls. The methods are represented by vertical stripes, progressing from left to right, and the active parts of the thread are identified by this left-to-right progression.





  4. You can examine specific parts of the graph by zooming in to a particular area, using the toolbar button.




    Similarly, you can use the toolbar button to zoom out.



  5. For sections of the graph that may be cluttered from repetitive calls due to iterative constructs, you can use the pop-up menu option Detect All Repetitions to consolidate the repetitions in the graph. The repetitive calls are marked with an X.n where n is the number of calls. In the example below, the getPackageName method is called 2 times.



    Similarly you can use the pop-up menu option Hide All Repetitions to hide the repetitions in the graph.


Tips

Related concepts
Overview of the Java Profiler
Execution flow view and table

Related tasks
Profiling an application
Launching or attaching to a process for profiling