Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lightweight Asynchronous Sampling Profiler with JProfiler (AsyncGetCallTrace)

I recently read a blog entry by Jeremy Manson (Google), about how a more accurate and lightweight asynchronous sampling profiler. It relies on the "AsyncGetCallTrace" undocumented method in hotspot JVMs to gather the stack trace of a thread.

http://jeremymanson.blogspot.fr/2013/07/lightweight-asynchronous-sampling.html

My question to the JProfiler community is: can JProfiler in its current 7.2.3 version use AsyncGetCallTrace? Is this feature in the work for say JProfiler 8.0?

like image 437
Antoine CHAMBILLE Avatar asked Jul 12 '13 09:07

Antoine CHAMBILLE


People also ask

What is JProfiler used for?

JProfiler is a Java profiler tool and is useful for developers/testers as it can be used to analyze performance bottlenecks, memory leaks, CPU loads, and to resolve threading issues. JProfiler works both as a stand-alone application and as a plug-in for the Eclipse software development environment.

What is async-profiler?

Async-profiler is a program that enables continuous monitoring and profiling of Java applications. Once switched on, it monitors several performance metrics of a Java app and saves them to a file. The data can be conveniently viewed in the form of a flame graph (Fig. 1).

How add async-profiler to IntelliJ?

Profiler Configurations. We can configure async-profiler in IntelliJ IDEA by selecting the Java Profiler menu option at Settings/Preferences > Build, Execution, Deployment: Also, for quick usage, we can choose any predefined configuration, like the CPU Profiler and the Allocation Profiler that IntelliJ IDEA offers.

What is Safepoint bias?

Safepoint bias problem The problem here is that the application threads are stopped only at safepoints and therefore when profilers get stack trace samples at predefined intervals, the stack traces are retrieved only at next available safepoint poll location.


1 Answers

The tools interface of the JVM (JVMTI) that is used by profilers has a large test harness that ensures its compatibility and stability for each release. AsyncGetCallTrace is not part of that specification. The overhead of GetStackTrace is so low that it is not advisable for a general purpose profiler to sacrifice the benefits of a supported API for the percieved gains of an unsupported method.

like image 182
Ingo Kegel Avatar answered Sep 19 '22 14:09

Ingo Kegel