Sampling profilers are popular because of their low and adjustable overhead and because they do not distort the profile by modifying the application code. A typical sampling pro-filer periodically suspends the application threads, walks their stacks, and merges the resulting stack traces into a calling context tree. Java virtual machines offer a convenient interface to accomplish this, but rely on safepoints, a synchronization mechanism that requires all threads to park in a safe location. However, a profiler is primarily interested in the running threads, and waiting for all threads to reach a safe location significantly increases the overhead. In most cases, taking a complete stack trace is also unnecessary because many stack frames remain unchanged between samples. We present three techniques that reduce the overhead of sampling Java applications. Partial safepoints require only a certain number of threads to enter a safepoint and can be used to sample only the running threads. With self-sampling, we parallelize taking stack traces by having each thread take its own stack trace. Finally, incremental stack tracing constructs stack traces lazily and examines each stack frame only once instead of walking the entire stack for each sample. Our techniques require no support from the operating system or hardware. With our implementation in the popular HotSpot virtual machine, we show that we can significantly reduce the overhead of sampling without affecting the accuracy of the profiles.
CITATION STYLE
Hofer, P., Gnedt, D., & Mössenböck, H. (2015). Lightweight java profiling with partial safepoints and incremental stack tracing. In ICPE 2015 - Proceedings of the 6th ACM/SPEC International Conference on Performance Engineering (pp. 75–86). Association for Computing Machinery, Inc. https://doi.org/10.1145/2668930.2688038
Mendeley helps you to discover research relevant for your work.