Category: jprofiler

Thread states in the CPU profiling views

In the screencast below, I explain the thread status selector and the different threads states in the CPU profiling views.

Overview of profiling views and profiling settings

We now have a list of screencasts for JProfiler on our web site that is generated from this blog. In order to include the older demos (without audio) into that list, I post them below:

  • Overview of profiling views in JProfiler See a brief overview of the most important profiling views in JProfiler. Some important functionality is shown to give you an idea on how JProfiler works.
  • Getting started and session settings See how easy it is to get started with profiling. Important aspects of the session configuration like profiling settings, triggers and method call recording filters are shown.

Both demos take about 7 minutes and open in a new window. The were recorded for JProfiler 5.0 but are still quite accurate for JProfiler 5.2.

Object counts in dynamic memory views and the heap walker

Often the question comes up why there are larger object counts in the dynamic memory views than in the heap walker. The simple explanation is that the dynamic memory views show all objects on the heap – even those that are unreferenced, while the heap walker only shows objects that are strongly referenced.

Here, for example, in the “All objects” view, a particular class has an object count of 6741:

In the heap walker, the object count is only 6282:

The difference comes from objects that are not referenced anymore, but that are still on the heap because the garbage collector has not collected them yet. Clicking on the “Run GC” button in JProfiler might collect some, but not all of them, since the garbage collector does not do full collections in modern JVMs. However, when you take a heap snapshot, a full collection is done internally, so you only look at objects that you can actually do something about.

Ideally, we would exclude unreferenced objects from the dynamic memory views too, but this information requires an expensive calculation that can only be performed when taking a heap snapshot.