Whats the difference between instrumentation and sampling?
For CPU profiling, there are two fundamentally different ways to collect information: • When sampling, a timer thread suspends all threads periodically (typically every 10 ms) and looks up the call stack of each thread. Each period is booked to the “least common denominator” of two subsequent measurements. While sampling is very fast, it has a shallow information depth because of its coarse resolution and the inability to provide an invocation count. Sampling is ideal for fast bottleneck detection. • With instrumentation, the entry and the exit of each method call are intercepted by JProfiler’s agent library. This way, an accurate measurement of the elapsed time can be made. If you have selected “estimated CPU times” in the sessions settings, the elapsed times are subject to a correction algorithm (see below).