Beneath the Bytecode: Observing the JVM at Work Using Bytecode Instrumentation
Many dynamic program analysis (DPA) tools for profiling, debugging, and monitoring programs executing on managed platforms such as the Java Virtual Machine (JVM) rely on bytecode instrumentation (sometimes combined with agents utilizing the JVM Tool Interface and native code libraries) to observe the base program behavior. While this is both the recommended and preferred technique for implementing DPA tools, it has certain noticeable drawbacks.
One, the analysis runs in the same process as the base program, and often shares the Java Class Library (JCL) and other resources with the base program. This creates potential for interference that may result in deadlocks, or state corruption in code that does not expect reentrancy. Two, certain parts of the JCL are typically off-limits for instrumentation, because they either play a vital role during the JVM bootstrap, or the JVM implementation makes certain assumptions about properties of specific classes, or both. These two issues are typically solved by reducing the scope of the instrumentation, leading to under-approximation of the program’s behavior.
And three, bytecode instrumentation only allows observig base program events at the bytecode level. The instrumentation code remains oblivious to optimizations performed by the dynamic compiler, and conversely, the compiler is completely unaware of the presence of the instrumentation code. Because the instrumentation code may significantly inflate the base program code and create additional data dependencies as a result of observing the program’s behavior, various optimizations performed by the dynamic compiler (e.g., inlining, partial escape analysis, code motion) will be perturbed by the presence of the instrumentation code. As a result, the dynamic analysis may observe events that would not have happened in the base program had it been left alone, thus over-approximating the actual behavior.
In this talk, we will discuss some of the challenges in making the JVM more observable for instrumentation-based DPA tools, with specific focus on getting accurate profiling information in presence of an optimizing dynamic compiler.
Lubomír is an assistant professor at the Department of Distributed and Dependable Systems, Charles University, Prague, Czech Republic. His primary research interests include performance-related topics focusing on performance evaluation, testing, and monitoring. In addition to performance, his research interests include also dynamic program analysis, with specific focus on making the programs running on the Java (and Dalvik) Virtual Machines more observable. He holds an MSc. from the Czech Technical University in Prague, and a PhD from the Charles University in Prague. He is a member of the ACM.
Conference DayMon 18 JulDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
10:05 - 12:25
|Beneath the Bytecode: Observing the JVM at Work Using Bytecode Instrumentation|
Lubomír BulejCharles UniversityMedia Attached File Attached
ICOOOLPSMedia Attached File Attached
|Virtual Machine Warm-up Blows Hot and Cold|
Edd BarrettKing's College London, Carl Friedrich Bolz-TereickKing's College London , Rebecca KillickDepartment of Mathematics and Statistics, University of Lancaster, Vincent KnightSchool of Mathematics, Cardiff University, Sarah MountKing's College London, Laurence TrattKing's College LondonLink to publication Media Attached File Attached