Category: jprofiler

Using the “Run interceptor script” trigger action

In the screen cast below I show how to use the “Run interceptor script” trigger action in a method trigger to print out some internal state of the application for debugging purposes. This is done without recompiling or restarting the application.

Creating a custom probe

This version is outdated. There is a newer version of this screen cast.

In this screen cast I show how to create a simple custom probe that measures how often the paint method of the “Animated Bezier Curve” demo is called together with clip bounds information. The example custom probe features events, telemetries and hot spots view.

Inspections in the heap walker

In this screencast, I show what inspections are available in in JProfiler’s heap walker and what they are capable of. Also featured is the powerful custom grouping inspection that lets you group object sets with a code snippet that is directly entered in the JProfiler GUI.

Heap walker graph: Finding paths between selected instances

In this screencast, I discuss the graph view of the heap walker (new in JProfiler 7.0) and how to search for reference paths between two selected objects. Also, I show how to resolve transitive references in the biggest objects view with the help of the graph view.

Filtering in the reference view of the heap walker

In the screencast below, I show the powerful filtering capabilities in the outgoing reference view of the heap walker that allow you to find objects based on primitive field values, outgoing references or code snippets.

CPU profiling: Sampling and instrumentation

In this screencast, I explain the two modes of CPU profiling, sampling and instrumentation and how they are activated in the JProfiler GUI. Choosing and understanding these modes is important for getting good results.

Methods statistics and exceptional method runs

In the screencast below, I explain how to analyze exceptionally slow invocations of frequently invoked methods. By using the method statistics and exceptional method run features in JProfiler, the slowest invocations are shown separately in the call tree.




The test class that is profiled in this screen cast is given below:

import java.util.Random;

public class MethodStatisticsTest {

private static Random random = new Random(0);

public static void main(String[] args) {
while (true) {
doCriticalTask();
}
}

private static void doCriticalTask() {
if (random.nextInt(1000) % 999 == 0) {
implOne();
} else {
implTwo();
}
}

private static void implOne() {
for (int i = 0; i < 100000; i++) {
Math.sqrt(i);
}
}

private static void implTwo() {
for (int i = 0; i < 1000; i++) {
Math.sqrt(i);
}
}
}