ByCounter: Portable Runtime Counting of Bytecode Instructions and Method Invocations

Size: px
Start display at page:

Download "ByCounter: Portable Runtime Counting of Bytecode Instructions and Method Invocations"

Transcription

1 ByteCode 2008 ByCounter: Portable Runtime Counting of Bytecode Instructions and Method Invocations Michael Kuperberg 1 Martin Krogmann 2 Ralf Reussner 3 Chair for Software Design and Quality Institute for Program Structures and Data Organisation Faculty of Informatics, Universität Karlsruhe (TH) Abstract For bytecode-based applications, runtime instruction counts can be used as a platform-independent application execution metric, and also can serve as the basis for bytecode-based performance prediction. However, different instruction types have different execution durations, so they must be counted separately, and method invocations should be identified and counted because of their substantial contribution to the total application performance. For Java bytecode, most JVMs and profilers do not provide such functionality at all, and existing bytecode analysis frameworks require expensive JVM instrumentation for instruction-level counting. In this paper, we present ByCounter, a lightweight approach for exact runtime counting of executed bytecode instructions and method invocations. ByCounter significantly reduces total counting costs by instrumenting only the application bytecode and not the JVM, and it can be used without modifications on any JVM. We evaluate the presented approach by successfully applying it to multiple Java applications on different JVMs, and discuss the runtime costs of applying ByCounter to these cases. Key words: Java, bytecode, counting, portable, fine-grained 1 Introduction The runtime behaviour of applications has functional aspects such as correctness, but also extra-functional aspects, such as performance. The runtime behaviour of a Java application can be described by analysing the execution of the application s Java bytecode instructions. Execution counts of these instructions are needed for bytecode-based performance prediction of Java applications [?], and also for dynamic bytecode metrics [?]. 1 michael.kuperberg@informatik.uni-karlsruhe.de 2 martin.krogmann@informatik.uni-karlsruhe.de 3 reussner@ipd.uka.de This paper is electronically published in Electronic Notes in Theoretical Computer Science URL:

2 As different instruction types have different execution durations, they must be counted separately. Also, method invocations should be identified due to the substantial contribution of methods to the total application performance. Thus, each method signature should have its own counter. To obtain all these runtime counts, static analysis (i.e. without executing the application) could be used, but it would have to be augmented to evaluate runtime effects of control flow constructs like loops or branches. Even if control flow consideration is attempted with advanced techniques such as symbolic execution, additional effort is required for handling infinite symbolic execution trees [?, pp ]. Hence, it is often faster and easier to use dynamic (i.e. runtime) analysis for counting executed instructions and invoked methods. However, dynamic counting of executed Java bytecode instructions is not offered by Java profilers or conventional Java Virtual Machines (JVMs). Existing program behaviour analysis frameworks for Java applications (such as JRAF [?]) do not differentiate between bytecode instruction types, do not identify method invocations performed from bytecode, or do not work at the level of bytecode instructions at all. These frameworks frequently rely on the instrumentation of the JVM, however, such instrumentation requires substantial effort and must be reimplemented for different JVMs. The contribution of the paper is a novel approach for lightweight portable runtime counting of Java bytecode instructions and method invocations. Its implementation is called ByCounter and it works by instrumenting the application bytecode instead of instrumenting the JVM. Through this, By- Counter can be used with any JVM, and the instrumented application can be executed by any JVM, making the ByCounter approach truly portable. Furthermore, ByCounter does not alter existing method signatures in instrumented classes nor does it require wrappers, so the instrumentation does not lead to any structural changes in the existing application. To make performance characterisation through bytecode counts more precise, runtime parameters of some bytecode instructions must be considered, as they can have significant impact on their performance [?]. For these cases, ByCounter provides basic parameter recording (e.g. for the array-creating instructions), and it also offers extension hooks for the recording mechanism. The presented approach is evaluated on two different Java virtual machines using applications that are subsets of three Java benchmarks. For these applications, our evaluation shows that despite accounting of single bytecode instructions, the ByCounter overhead during the counting phase at runtime is reasonably low (between ca. 1% and 85% in all cases except one outlier), while instrumenting the bytecode requires < 0.3 s in all studied cases. The paper is structured as follows: in Section 2, we outline the foundations of our approach. Section 3 provides an overview over how ByCounter works, while Section 4 describes its implementation. Section 5 presents our evaluation, before related work is presented in Section 6. Finally, we list our assumptions and limitation in Section 7 and conclude the paper in Section 8. 2

3 2 Foundations Java bytecode is executed on the Java Virtual Machine (JVM), which abstracts the specific details of the underlying software/hardware platform, making compiled Java classes portable across different platforms for which JVMs are offered. Each JVM is supplied with a set of Java classes that form the (vendor-specific) implementation of the Java API. In Java bytecode, four instructions are used to invoke Java methods, including those of the Java API: INVOKEINTERFACE, INVOKESPECIAL, INVOKE- STATIC and INVOKEVIRTUAL (hereafter called INVOKE*). The signature of the invoked method appears as the parameter of the INVOKE* instruction, while the parameters of the invoked method are prepared on the stack before method invocation. If an invoked method is part of the Java API, its implementation can be different across operating systems, as it may call platform-specific native methods (e.g. for file system access). To avoid platform-dependent counts, invocations of API and all other methods must initially be counted as they appear in application s bytecode, without decomposing them into the elements of their implementation. This results in a flat view, which summarises the execution of the analysed method in a platform-independent way. If needed, counts for the invoked methods can be obtained using the same approach, too. Using this additional information, counts for the entire (expanded) calling tree of the analysed method can be computed, and such stepwise approach promotes reuse of counting results. For bytecode-based performance prediction, parameters of invoked methods, but also parameters of non-invoke* bytecode instructions can be significant, because they influence the execution speed of the instruction [?]. The latter parameters and their locations are described in the JVM specification [?]; for example, the MULTIANEWARRAY instruction is followed by the array element type and the array dimensionality directly in the bytecode, while the sizes of the individual array dimensions have to be prepared on the stack. Hence, in order to describe the runtime behaviour of programs as precisely as possible, the approach must be able to record such parameters. However, parameter recording slows down the execution of the instrumented methods, and parameters may be relevant only in specific cases and only for some instructions or methods. As Java bytecode instructions or methods can have parameters of arbitrary object types, persistent parameter recording by simply saving the parameter value may be irrational, or even technically impossible. In such a case, a characterisation of the parameter object instance should be recorded: for a (custom) data structure, its size could be a suitable characterisation. Hence, to allow users to provide their own characterisations for Java classes of their choice, the approach must offer suitable extension hooks. In the next section, we provide an overview on our implementation of this approach, and how it handles the issues described in this section. 3

4 3 Overview of the ByCounter Process Parse program bytecode Instrument bytecode before execution ILOAD 2. Instrument ILOAD IINC C1 IADD parsed program IADD representation IINC C8 3. Convert into executable bytecode Execute instrumented bytecode 4. Create parameters 5. Replace original 6. Run instrumented for class constructors with instrumented bytecode, collect + method invocations bytecode classes counting results 27865*ILOAD 11108*IADD Fig. 1. Bytecode instrumentation and instruction counting using ByCounter In Fig. 1, all 6 steps of the process performed by ByCounter are shown. Following these process steps, this section describes the design rationale behind ByCounter and explains important design decisions that were made. Further details of the ByCounter implementation and of executing the instrumented bytecode will be described in Section 4. In step 1, ByCounter parses the existing bytecode class file into a navigable, structured representation, because direct manipulation of bytecode is very complex and error-prone. ByCounter uses the ASM bytecode engineering framework [?], which offers a bytecode class representation that includes semantic details (method signatures, fields, etc.). ASM s bytecode representation can be accessed and changed through the ASM API, which follows the visitor pattern. Using the ASM API, custom visitors can be created to add, change or delete the elements of the class representation down to the level of individual bytecode instructions. In step 2, ByCounter inserts counting instrumentation into the bytecode representation using a special ASM class visitor that we have written. The basic principle behind the visitor is to add new counters to existing bytecode. Later, during the execution the instrumented method, these counters will be initialised, incremented, evaluated and finally reported. Step 2 has to be implemented with the following objectives in mind: (i) it must not change the existing fields, variables, method signatures, class structure and execution semantics; (ii) the instrumentation has to account for each instruction individually with as few additional instructions and overhead as possible and (iii) for methods with control flow constructs (loops, ) that depend on the input parameters, counts must be reported correctly for any execution path, i.e. for all allowed values of input parameters. In step 3, the instrumented representation of the class is converted back into executable bytecode, which can be written into a class file and which can 4

5 also be used by ByCounter-provided ClassLoader. Step 3 concludes the instrumentation part and is followed by the execution part, which consists of steps 4 to 6. In step 4, execution of the instrumented method is prepared. In any case, it is the responsibility of the user to provide the prerequisites for the execution of the instrumented class. If the instrumented class will be run in the same context as the uninstrumented one, the preparations are absolutely identical to those for executing the uninstrumented class, and should already be fulfilled by the existing context. However, for running the instrumented class and its methods in isolation, preparations would include providing the parameters for class construction/initialisation and for method invocation, as well as providing required services. In step 5, the instrumented class must replace the original, uninstrumented class inside the deployed application. The most straightforward way to do this is to restart the application after replacing the original class bytecode with the new, instrumented version. If such a restart is not possible or not desirable, ByCounter can be connected to the JDK s Java Instrumentation API (java.lang.instrument package) or other tools that support class/method replacement and redefinition even after the application has started. In step 6, the instrumented method is run to count and to report executed bytecode instructions and method invocations. If needed, this step can be repeated with different input parameters of the instrumented method. Step 6 is the final step performed by ByCounter, after which the original, uninstrumented class can be reinstated if needed. 4 Implementation of ByCounter Following the overview in Fig. 1, the first step of ByCounter is to parse a Java class using the ASM framework [5]. Then, in step 2, ByCounter adds instrumentation for three tasks: for setup of the counting infrastructure, for counter incrementation and finally for reporting of the results. Users can specify which methods should be instrumented for counting and which methods should be left in the original, uninstrumented state. Otherwise, no manual intervention is needed from the user. 4.1 Creating and Using the Counters A suitable data structure must be selected for the counters. The JVM specification [?] lists 200 working bytecode instructions, including four INVOKE* instructions. Hence, these instructions require a fixed number of counters. In contrast to that, it depends on the application which and how many different methods will be invoked using INVOKE* in the instrumented method. Hence, in principle, method invocations inside the instrumented bytecode should be counted using a data structure which allows a dynamic addition of new counters for found method signatures. For ByCounter, the counters for 5

6 method invocations could be stored in a java.util.map-like data structure. At runtime, this structure can be easily extended, however, each access to a Map-like structure for incrementing a counter is very expensive. Thus, a more efficient technique is used in ByCounter by creating int counters for both method invocations and other bytecode instructions. The basic idea behind this technique is to perform an initial discovery pass over the bytecode for identifying all method signatures that occur in the bytecode of the considered method. Using the results of this pass, ByCounter can create precisely the required number of int counters. Incrementing an int counter can be done efficiently using a single IINC instruction. The list of method signatures will not grow at runtime, except in cases where other bytecode-instrumenting operations take place after ByCounter instrumentation. Hence, for correct counting results, we require that By- Counter is the last tool in the bytecode instrumentation chain. It must further be noted that the same discovery pass could identify non-invoke* instructions that really occur in the considered bytecode, but this enhancement ultimately results in more overhead than simply creating counters for all instructions. This list of found signatures might contain some methods that will not always be executed at runtime, because the execution path does not reach them for some values of input parameters passed to the instrumented method. The case-specific non-execution of these methods is not problematic, as the corresponding counts will simply maintain their initial value of 0. After the list of found method signatures has been populated in the discovery pass, ByCounter performs its main pass over bytecode. In the main pass, counters of type int for method invocations (as many as different signatures found during the discovery pass) are added to bytecode through instrumentation. Additionally, counters of type int are added for all 200 defined bytecode instructions. From the bytecode view, these counters are local variables. The maximum number of local variables in the bytecode of a Java method is (incl. those variables that existed before instrumentation), and this number shouldn t be a limitation in realistic cases. Additionally, to support bytecode-based performance prediction, the current version of ByCounter is able to record the dimension(s) and the element types of arrays created using ANEWARRAY, MULTIANEWARRAY and NEWARRAY instructions. The recording is optional; it is done using a set of additional Lists that save these details. In the future, functionality for recording parameters of other instructions and methods will be added to ByCounter. After creating the counters, ByCounter adds instrumentation to update (i.e. increment) them when the corresponding instructions and methods are executed. The IINC instruction does not modify the stack (it directly increments the underlying local variable ), so no side effects will occur at runtime. Recording of the dimensions of created arrays is also implemented in a way that does not produce any side effects. 6

7 4.2 Reporting the Counting Results Kuperberg, Krogmann, Reussner For reporting of counting results, two alternatives have been implemented in ByCounter, and both preserve the integrity of method signatures in the instrumented class. The first alternative instruments the method with code to directly write a log file with the counting results; for this, no additional classes must be loaded manually into the JVM. Details of the log file writing, such as the log file path, can be configured by the ByCounter user before the instrumentation starts. The second alternative is based on ByCounter s ResultCollector class, and has the advantage that it can aggregate and reference counts of different methods. In order to report the state of counters using ResultCollector, a call to its collectresults method is inserted by the instrumentation. Additionally, the ResultCollector class must be loaded into the JVM. Instead of reporting counting results periodically (e.g. after a certain time, or after a certain number of instructions has been counted), ByCounter is implemented to report the complete results immediately before the instrumented method exits. However, if a method declares possible exceptions in its signature (instead of the exception table), there is no way to foresee from the bytecode where and when method execution will exit due to an exception; in such a case, it can be assumed that the obtained counts are not representative. At the same time, exceptions declared using try/catch/finally are handled properly in ByCounter, as they are a part of the normal control flow. Thus, the ByCounter implementation ensures that the counting results are reported if and only if the method exits properly (i.e. if it returns without an uncaught exception). To achieve this, for both reporting alternatives (log file and ResultCollector), ByCounter adds instructions that report the result immediately preceeding every return -like bytecode instruction. These instructions include areturn, dreturn etc., depending on the type of returned value (bytecode of methods returning void also uses a return instruction). As the proper execution of a method always terminates with exactly one *return instruction, any such *return instruction is accounted for properly by pre-initialising the corresponding counter with 1. For the interpretation of the counting results, it can be important to have knowledge about the runtime parameters of the instrumented method itself. Hence, ByCounter is designed to store the characterisations of these parameters at the beginning of the method s execution and can report them together with the counting results. These characterisations can be the length of a String, size of an array etc. After the instrumentation has been completed, ByCounter converts the instrumented ASM bytecode representation into a Java class which is to substitute the original, uninstrumented class. The instrumented class can be saved as a class file, or passed to a suitable ClassLoader for immediate, reflectionbased invocation. 7

8 5 Case Study and Evaluation In this section, a case study is presented to show the efficiency and the precision of instrumentation and counting performed by ByCounter. The precision of ByCounter was evaluated by comparing ByCounter counting results with manually obtained results. For manual calculation of counts, the input parameters and their impact on the control flow of the considered method have to be evaluated. To make counting results comparable, it was required that an evaluated method has a deterministic execution when it is executed with the same set of input parameters. As described in Section 5.1 below, suitable Java methods have been selected and evaluated. The efficiency of ByCounter was evaluated by measuring (1) the duration of the instrumentation phase performed by ByCounter, (2) the execution duration of a method run before instrumentation and (3) the execution duration of the instrumented method. For (2) and (3), the same input parameters were used to be able to compare the results. From (2) and (3), the relative overhead caused by the counting process at runtime was computed and is reported below. 5.1 Study Setup For evaluating ByCounter, three Java benchmarks that are publicly available with their source code were used. The following methods have been instrumented and measured: (i) JavaGrande benchmark [?,?]: method JGFrun() of class JGFCastBench, 216 LOC (lines of Java source code excluding comments and empty lines) (ii) Linpack benchmark [?] (Java implementation available from [?]): method run_benchmark() of class Linpack, 60 LOC (iii) SciMark 2.0 benchmark [?]: method integrate(int Num_samples) of class MonteCarlo, only 9 LOC (parameter is passed to the method, so the contained loop with 5 LOC is repeated times) To ensure deterministic behaviour in repeated runs, loop conditions in JGFCast Bench.JGFrun() were slightly modified. Furthermore, JGFCastBench bytecode contained many effectless casting instructions whose execution can be skipped (and is actually skipped after JIT compilation by some JVMs). Hence, we have enhanced and recompiled the source code of JGFCastBench to prevent skipping of these instructions by the JVMs that were used in this case study. Of course, the platform on which ByCounter is executed has an influence on the performance, both for instrumentation phase and for the execution of instrumented bytecode. For the JVM as a part of this platform, different vendors implement optimisations of bytecode execution in different ways, and the resulting impact on the performance is of particular interest. 8

9 Thus, we compared Bea JRockit JDK 6 Update 2 R (32bit) and Sun JDK JVM on a computer with the Intel Core Duo T2400 CPU at 1.83 GHz, 1.50 GB of RAM and with Windows XP Pro operating system. The load on the machine has been minimised during measurements, and thread/process priorities have not been changed. The JVMs were run in server mode using the -server flag. If a measurement is repeated several times in a row, the JVM may have more opportunities to optimise the measured code. While the instrumentation phase will likely be performed only once, an (un)instrumented method can be executed several times in a realistic application. Thus, for evaluating the counting-caused overhead, measurements of both uninstrumented and instrumented methods must be repeated appropriately. As a consequence, for each of the three studied benchmarks and for each of the JVMs, we have performed 100 JVM runs with 200 repetitions of these measurements in each JVM run. 5.2 Measurements and Results After the precision of counting results was successfully verified through aforementioned manual bytecode inspection, measurements were performed. Table 1 aggregates the results of the measurements; due to space limitations, we do only report the median values and not the full statistical evaluation. The most interesting metric in Table 1 is the overhead introduced by By- Counter, which is between <1% (Linpack, Bea JVM) and 84.6% (Java- Grande, Sun JVM), except for one outlier (SciMark, Bea JVM). benchmark name JavaGrande Linpack SciMark Java VM Bea Sun Bea Sun Bea Sun instrumentation [ms] uninstrumented method execution duration [ms] instrumented method execution duration [ms] , , counting overhead [%] < total count of executed bytecode instructions total count of executed method invocations 103,050,724 4,912 20,784, ,000,001 Table 1 ByCounter evaluation for 3 benchmarks and 2 JVMs (obtained individual counts of bytecode instructions and method invocations are not shown) 9

10 We have studied measurements of this outlier to understand the reason for such exceptionally large overhead, and have come to the conclusion that the optimisation mechanism of the Bea JVM does not work well for the instrumented version of SciMark: if optimisations are turned off using -Xnoopt flag, the uninstrumented version of SciMark runs in ms, while the instrumented one runs in ms, resulting in a counting overhead of 68.9%. In fact, the counting overhead for running SciMark using -Xnoopt is very close to the overhead for SciMark executed in the Sun JVM. Also, when normal and -Xnoopt runs are compared for the instrumented SciMark version in the Bea JVM, the -Xnoopt run is slower by a factor of But if normal and -Xnoopt Bea runs are compared for the uninstrumented SciMark version, the slowdown factor is 3.48 (28.92 ms vs ms), i.e. exceptionally high. Observed differences between the overhead percentages in Table 1 are explained through the different structure of the instrumented methods. For example, in the JavaGrande case, there is a very large number of counted instructions, but a small number of method invocations (and the invoked methods are computationally expensive), so the relative counting overhead is between 27.4% (Bea) and 84.5% (Sun). In the Linpack case, significantly fewer instructions must be counted, yet the invoked methods are computationally expensive (i.e., they have longer execution durations). As these invoked methods have not been instrumented, they have the same execution duration no matter whether they are called from the instrumented or uninstrumented version of Linpack s run_benchmark method. Hence, for Linpack s run_benchmark method, the costs of counting these invoked methods are very small in relation to their execution duration of the invoked methods. It can also be observed that the used JVMs lead to very different method execution durations, and that none of the JVMs is the fastest for all three benchmarks. The cost of the instrumentation phase is also reasonably small (below 300ms for all benchmarks in all JVMs). Before assumptions and limitations are discussed in Section 7, we describe related work and compare it to our approach in the next section. 6 Related Work Bytecode instruction counts can be considered as a dynamic bytecode metric. In [?], a collection of other metrics for Java bytecode is presented, but that collection does not include execution counts for individual bytecode instructions and method invocations. Existing approaches for dynamic (runtime) counting of Java bytecode instructions and method invocations can be grouped into three categories, according to the technology they rely upon: (a) using monitoring/reporting interfaces provided by the JVM (b) by instrumenting the JVM or its API-implementing library (c) by instrumenting the actual application bytecode or source. 10

11 For case (a), different interfaces are explicitly exposed by JVMs, such as JVMTI[?], which must be programmed in a native language. These interfaces are used by standalone Java tools and profilers, such as Intel VTUNE [?]. In general, profilers measure resource usage and need manual supervision and interpretation. In contrast to that, ByCounter obtains exact counts of executed instructions without human supervision of the counting process. Since Java 6, direct access to individual bytecode instructions with Javaown means is possible only with JVMTI - for this, execution of bytecode must be single-stepped, substantially slowing down bytecode execution. JVMTI is not a mandatory part of the JVM standard, and many virtual machines (such as Jikes RVM [?]) do not implement JVMTI at all. Hence, JVMTI is not suitable as a portable basis for platform-independent bytecode counting when compared to bytecode instrumentation. In category (b), two parts of a JVM must be differentiated: the bytecode interpreter with its components and the JVM s Java API implementation, which consists of (partially platform-specific) Java classes. Instrumenting the first part means dealing with native (non-java) code or binaries, which is generally a complicated, both platform-specific and JVM-specific task. Instrumenting the API implementation means instrumenting Java bytecode or source code of a very large number of Java classes. For both JVM parts, commercial JVMs usually do not provide the source code. JVM instrumentation is done for replaying the behaviour of multi-threaded Java programs, for example in [?] and similar approaches; however, only highlevel constructs and not bytecode instructions or method invocations are considered. Vertical profiling approaches such as [?], [?] or [?] also use JVM instrumentation, and only consider high-level events, too. JRAF / FERRARI [?] instruments the entire Java API, but it could not be obtained for evaluation. The available documentation shows that it does not offer counting of individual bytecode instructions and method invocations, as its instrumentation maintains only one counter for all bytecode instructions. Furthermore, FERRARI captures JVM-specific calling context trees and not an expandable flat view as ByCounter does. To instrument bytecode, the Java API itself does not provide any means, but only methods to read/load already instrumented bytecode. Instead, external frameworks for bytecode engineering (such as ASM [?] or SOOT [?]) can be used, as they offer rich APIs for analysing and modifying bytecode. However, they do not include bytecode-counting functionality or instrumentation templates. For case (c), the actual application code must be instrumentated and then executed by the JVM. This approach is used in ByCounter. Generic frameworks for bytecode manipulation, such as SOOT [?], do not offer the functionality provided by ByCounter, they serve as tools to implement this functionality. For example, the ASM framework [?] was used for ByCounter. Aspect-oriented bytecode-analysing frameworks such as in [?] do not pro- 11

12 vide the instruction-counting functionality itself, but merely offer a different way to implement instrumentation when compared to ASM or other bytecode engineering frameworks. 7 Assumptions and Limitations We assume that it is possible to pass the final class bytecode that will be executed to ByCounter for instrumentation. For applications where bytecode is generated on the fly and not by the Java compiler (for example in Java EE application servers), additional provisions must be taken. We also assume that the bytecode to instrument conforms to the JVM specification, even if it has been protected using obfuscation. The ASM library that is used in ByCounter has one small limitation: ASM does not generate a 1:1 representation of parsed bytecode in a few cases. For example, ASM visitors consider the parameterless LLOAD_0 bytecode instruction to be the same as the (different) LLOAD instruction with parameter 0. Hence, ByCounter reports the four LLOAD_* instructions and the LLOAD instruction using one counter. However, as there is no semantical difference between the two instructions in the above example, it does not invalidate the semantical accuracy of ByCounter. If needed, this small limitation can be overcome by modifying the ASM library. Another current limitation of ByCounter is grounded in polymorphism. For example, when methods of interfaces are invoked, only the type of the interface is visible at bytecode level. Hence, the class implementing the interface cannot be identified unambiguously in the current implementation of ByCounter. However, handling of polymorphism can be achieved with additional effort. The obtained instruction counts depend on the input parameters that have been provided to the instrumented method, for example due to control flow constructs that depend on these parameters. Currently, this dependency cannot be expressed by ByCounter because neither control flow constructs are recognised by it, nor states of variables/fields during method execution are inspected. Finally, superfluous bytecode instructions can exist in an application, i.e. bytecode which can be optimized away by Just-In-Time (JIT) compiler of the JVM without effects on execution results. These instructions are instrumented by ByCounter as it cannot anticipate later JIT optimisations. The instrumentation instructions cannot be optimised away by JIT, with the effect that they increment counters even for those (superfluous) instructions that have been removed by JIT. We have observed such effect for a benchmark where counting would seem to slow down the execution by a factor of more than 900 in some cases (which is unrealistic given the ByCounter implementation). Hence, we assume that ByCounter is run on code that has been engineered effectively and does not 12

13 contain large portions of superfluous code. At the same time, ByCounter can hint at the existence of superfluous code through an exceptionally high runtime counting costs. 8 Conclusions This paper presents a novel, evaluated approach for dynamic counting of executed instructions and method invocations in bytecode-based applications. The approach is called ByCounter and it works by instrumenting the application bytecode, without the need to instrument or modify the JVM or the Java API implementation. An example usage of the counting results is the bytecode-based performance prediction [?], and these results could also be used for characterising the execution of a bytecode application. ByCounter will be made publicly available at By instrumenting the application bytecode and not the JVM, ByCounter simplifies the entire counting process and becomes truly portable accross JVMs. The instrumentation added by ByCounter is lightweight, leading to low runtime costs of counting. The evaluation of these costs and the overall counting effort is performed in this paper for several Java applications on different JVMs. In addition to being portable, the presented approach has been designed for easy use: no understanding of bytecode internals is needed to use it, and the application methods available for instrumentation are automatically identified and proposed to the user. To minimise disruptions, ByCounter instrumentation preserves the signatures of all methods and constructors, and it also preserves the application architecture. For reporting of counting results, ByCounter offers two alternatives: either using structured log files or using a result collector framework (the latter can aggregate counting results accross methods and classes). In the future, our work will be extended into several directions. First, it will be integrated into Palladio [?], which is an approach to predict the performance of component-based software architectures. Palladio uses models of software components, for which behaviour specifications with performance annotations must be created. For existing bytecode components, these annotations can be obtained through bytecode-based performance prediction. Such prediction needs two inputs: execution durations of individual bytecode instructions and invoked methods, as well as the counts of these instructions and invocations. Hence, the role of ByCounter in the Palladio approach is to support bytecode-based performance prediction by providing the counts of executed instructions and of method invocations. For the next version of ByCounter, several enhancements are being evaluated. For example, we have envisioned support for instrumenting userdefined sections of methods. Another feature could be polymorphic instrumentation: with this option, instrumentation of a method C.m() in class C 13

14 will be automatically accompanied by instrumentation of all methods m() in classes that extend class C. Finally, extending our approach to other virtual machines and their bytecode languages (for example.net runtime and its CIL bytecode) would allow the use ByCounter in heterogenous systems. Acknowledgements The authors would like to thank Klaus Krogmann for insightful discussions and the anonymous reviewers for their helpful comments. 14

ByCounter: Portable Runtime Counting of Bytecode Instructions and Method Invocations

ByCounter: Portable Runtime Counting of Bytecode Instructions and Method Invocations ByteCode 2008 ByCounter: Portable Runtime Counting of Bytecode Instructions and Method Invocations Michael Kuperberg 1 Martin Krogmann 2 Ralf Reussner 3 Chair for Software Design and Quality Institute

More information

Heuristics-based Parameter Generation for Java Methods

Heuristics-based Parameter Generation for Java Methods Universität Karlsruhe (TH) Research University founded 1825 Heuristics-based Parameter Generation for Java Methods Michael Kuperberg (mkuper@ipd.uka.de) Fouad Omri (fouad.omri@stud.uni-karlsruhe.de) Chair

More information

Method-Level Phase Behavior in Java Workloads

Method-Level Phase Behavior in Java Workloads Method-Level Phase Behavior in Java Workloads Andy Georges, Dries Buytaert, Lieven Eeckhout and Koen De Bosschere Ghent University Presented by Bruno Dufour dufour@cs.rutgers.edu Rutgers University DCS

More information

Untyped Memory in the Java Virtual Machine

Untyped Memory in the Java Virtual Machine Untyped Memory in the Java Virtual Machine Andreas Gal and Michael Franz University of California, Irvine {gal,franz}@uci.edu Christian W. Probst Technical University of Denmark probst@imm.dtu.dk July

More information

TRIREME Commander: Managing Simulink Simulations And Large Datasets In Java

TRIREME Commander: Managing Simulink Simulations And Large Datasets In Java TRIREME Commander: Managing Simulink Simulations And Large Datasets In Java Andrew Newell Electronic Warfare & Radar Division, Defence Science and Technology Organisation andrew.newell@dsto.defence.gov.au

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

YETI. GraduallY Extensible Trace Interpreter VEE Mathew Zaleski, Angela Demke Brown (University of Toronto) Kevin Stoodley (IBM Toronto)

YETI. GraduallY Extensible Trace Interpreter VEE Mathew Zaleski, Angela Demke Brown (University of Toronto) Kevin Stoodley (IBM Toronto) YETI GraduallY Extensible Trace Interpreter Mathew Zaleski, Angela Demke Brown (University of Toronto) Kevin Stoodley (IBM Toronto) VEE 2007 1 Goal Create a VM that is more easily extended with a just

More information

Trace Compilation. Christian Wimmer September 2009

Trace Compilation. Christian Wimmer  September 2009 Trace Compilation Christian Wimmer cwimmer@uci.edu www.christianwimmer.at September 2009 Department of Computer Science University of California, Irvine Background Institute for System Software Johannes

More information

Reverse Engineering of Parametric Behavioural Service Performance Models from Black-Box Components

Reverse Engineering of Parametric Behavioural Service Performance Models from Black-Box Components Reverse Engineering of Parametric Behavioural Service Performance Models from Black-Box Components Klaus Krogmann, Michael Kuperberg, and Ralf Reussner Institute for Program Structures and Data Organisation

More information

Summary: Open Questions:

Summary: Open Questions: Summary: The paper proposes an new parallelization technique, which provides dynamic runtime parallelization of loops from binary single-thread programs with minimal architectural change. The realization

More information

Static Analysis of Dynamic Languages. Jennifer Strater

Static Analysis of Dynamic Languages. Jennifer Strater Static Analysis of Dynamic Languages Jennifer Strater 2017-06-01 Table of Contents Introduction............................................................................... 1 The Three Compiler Options...............................................................

More information

Just-In-Time Compilation

Just-In-Time Compilation Just-In-Time Compilation Thiemo Bucciarelli Institute for Software Engineering and Programming Languages 18. Januar 2016 T. Bucciarelli 18. Januar 2016 1/25 Agenda Definitions Just-In-Time Compilation

More information

Executing Legacy Applications on a Java Operating System

Executing Legacy Applications on a Java Operating System Executing Legacy Applications on a Java Operating System Andreas Gal, Michael Yang, Christian Probst, and Michael Franz University of California, Irvine {gal,mlyang,probst,franz}@uci.edu May 30, 2004 Abstract

More information

High-Level Language VMs

High-Level Language VMs High-Level Language VMs Outline Motivation What is the need for HLL VMs? How are these different from System or Process VMs? Approach to HLL VMs Evolutionary history Pascal P-code Object oriented HLL VMs

More information

A Quantitative Evaluation of the Contribution of Native Code to Java Workloads

A Quantitative Evaluation of the Contribution of Native Code to Java Workloads A Quantitative Evaluation of the Contribution of Native Code to Java Workloads Walter Binder University of Lugano Switzerland walter.binder@unisi.ch Jarle Hulaas, Philippe Moret EPFL Switzerland {jarle.hulaas,philippe.moret}@epfl.ch

More information

Acknowledgements These slides are based on Kathryn McKinley s slides on garbage collection as well as E Christopher Lewis s slides

Acknowledgements These slides are based on Kathryn McKinley s slides on garbage collection as well as E Christopher Lewis s slides Garbage Collection Last time Compiling Object-Oriented Languages Today Motivation behind garbage collection Garbage collection basics Garbage collection performance Specific example of using GC in C++

More information

Parley: Federated Virtual Machines

Parley: Federated Virtual Machines 1 IBM Research Parley: Federated Virtual Machines Perry Cheng, Dave Grove, Martin Hirzel, Rob O Callahan and Nikhil Swamy VEE Workshop September 2004 2002 IBM Corporation What is Parley? Motivation Virtual

More information

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1 CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Winter 2008 3/11/2008 2002-08 Hal Perkins & UW CSE V-1 Agenda Java virtual machine architecture.class files Class loading Execution engines

More information

Offloading Java to Graphics Processors

Offloading Java to Graphics Processors Offloading Java to Graphics Processors Peter Calvert (prc33@cam.ac.uk) University of Cambridge, Computer Laboratory Abstract Massively-parallel graphics processors have the potential to offer high performance

More information

Notes of the course - Advanced Programming. Barbara Russo

Notes of the course - Advanced Programming. Barbara Russo Notes of the course - Advanced Programming Barbara Russo a.y. 2014-2015 Contents 1 Lecture 2 Lecture 2 - Compilation, Interpreting, and debugging........ 2 1.1 Compiling and interpreting...................

More information

Compiling Techniques

Compiling Techniques Lecture 10: Introduction to 10 November 2015 Coursework: Block and Procedure Table of contents Introduction 1 Introduction Overview Java Virtual Machine Frames and Function Call 2 JVM Types and Mnemonics

More information

Java On Steroids: Sun s High-Performance Java Implementation. History

Java On Steroids: Sun s High-Performance Java Implementation. History Java On Steroids: Sun s High-Performance Java Implementation Urs Hölzle Lars Bak Steffen Grarup Robert Griesemer Srdjan Mitrovic Sun Microsystems History First Java implementations: interpreters compact

More information

Automated Benchmarking of Java APIs

Automated Benchmarking of Java APIs Automated Benchmarking of Java APIs Michael Kuperberg 1, Fouad Omri 1, Ralf Reussner 1 1 Chair Software Design & Quality, Karlsruhe Institute of Technology (KIT) Am Fasanengarten 5, 76131 Karlsruhe, Germany

More information

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1 Agenda CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Summer 2004 Java virtual machine architecture.class files Class loading Execution engines Interpreters & JITs various strategies

More information

WHITE PAPER Application Performance Management. The Case for Adaptive Instrumentation in J2EE Environments

WHITE PAPER Application Performance Management. The Case for Adaptive Instrumentation in J2EE Environments WHITE PAPER Application Performance Management The Case for Adaptive Instrumentation in J2EE Environments Why Adaptive Instrumentation?... 3 Discovering Performance Problems... 3 The adaptive approach...

More information

Operating- System Structures

Operating- System Structures Operating- System Structures 2 CHAPTER Practice Exercises 2.1 What is the purpose of system calls? Answer: System calls allow user-level processes to request services of the operating system. 2.2 What

More information

On the Design of the Local Variable Cache in a Hardware Translation-Based Java Virtual Machine

On the Design of the Local Variable Cache in a Hardware Translation-Based Java Virtual Machine On the Design of the Local Variable Cache in a Hardware Translation-Based Java Virtual Machine Hitoshi Oi The University of Aizu June 16, 2005 Languages, Compilers, and Tools for Embedded Systems (LCTES

More information

WHITE PAPER: ENTERPRISE AVAILABILITY. Introduction to Adaptive Instrumentation with Symantec Indepth for J2EE Application Performance Management

WHITE PAPER: ENTERPRISE AVAILABILITY. Introduction to Adaptive Instrumentation with Symantec Indepth for J2EE Application Performance Management WHITE PAPER: ENTERPRISE AVAILABILITY Introduction to Adaptive Instrumentation with Symantec Indepth for J2EE Application Performance Management White Paper: Enterprise Availability Introduction to Adaptive

More information

Performance analysis basics

Performance analysis basics Performance analysis basics Christian Iwainsky Iwainsky@rz.rwth-aachen.de 25.3.2010 1 Overview 1. Motivation 2. Performance analysis basics 3. Measurement Techniques 2 Why bother with performance analysis

More information

A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler

A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler A Trace-based Java JIT Compiler Retrofitted from a Method-based Compiler Hiroshi Inoue, Hiroshige Hayashizaki, Peng Wu and Toshio Nakatani IBM Research Tokyo IBM Research T.J. Watson Research Center April

More information

CS577 Modern Language Processors. Spring 2018 Lecture Interpreters

CS577 Modern Language Processors. Spring 2018 Lecture Interpreters CS577 Modern Language Processors Spring 2018 Lecture Interpreters 1 MAKING INTERPRETERS EFFICIENT VM programs have an explicitly specified binary representation, typically called bytecode. Most VM s can

More information

Run-time Program Management. Hwansoo Han

Run-time Program Management. Hwansoo Han Run-time Program Management Hwansoo Han Run-time System Run-time system refers to Set of libraries needed for correct operation of language implementation Some parts obtain all the information from subroutine

More information

JVM. What This Topic is About. Course Overview. Recap: Interpretive Compilers. Abstract Machines. Abstract Machines. Class Files and Class File Format

JVM. What This Topic is About. Course Overview. Recap: Interpretive Compilers. Abstract Machines. Abstract Machines. Class Files and Class File Format Course Overview What This Topic is About PART I: overview material 1 Introduction 2 Language processors (tombstone diagrams, bootstrapping) 3 Architecture of a compiler PART II: inside a compiler 4 Syntax

More information

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc. Chapter 1 GETTING STARTED SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: Java platform. Applets and applications. Java programming language: facilities and foundation. Memory management

More information

JOVE. An Optimizing Compiler for Java. Allen Wirfs-Brock Instantiations Inc.

JOVE. An Optimizing Compiler for Java. Allen Wirfs-Brock Instantiations Inc. An Optimizing Compiler for Java Allen Wirfs-Brock Instantiations Inc. Object-Orient Languages Provide a Breakthrough in Programmer Productivity Reusable software components Higher level abstractions Yield

More information

Intel Authoring Tools for UPnP* Technologies

Intel Authoring Tools for UPnP* Technologies Intel Authoring Tools for UPnP* Technologies (Version 1.00, 05-07-2003) INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE,

More information

Improving Java Code Performance. Make your Java/Dalvik VM happier

Improving Java Code Performance. Make your Java/Dalvik VM happier Improving Java Code Performance Make your Java/Dalvik VM happier Agenda - Who am I - Java vs optimizing compilers - Java & Dalvik - Examples - Do & dont's - Tooling Who am I? (Mobile) Software Engineering

More information

Future of JRockit & Tools

Future of JRockit & Tools Future of JRockit & Tools Or finding the right layer to attack Joakim Dahlstedt 15 September 2004 A Short Background on JRockit Server-centric JVM Java compatible (most of the Java libraries are Suns)

More information

Course Overview. PART I: overview material. PART II: inside a compiler. PART III: conclusion

Course Overview. PART I: overview material. PART II: inside a compiler. PART III: conclusion Course Overview PART I: overview material 1 Introduction (today) 2 Language Processors (basic terminology, tombstone diagrams, bootstrapping) 3 The architecture of a Compiler PART II: inside a compiler

More information

Java Instrumentation for Dynamic Analysis

Java Instrumentation for Dynamic Analysis Java Instrumentation for Dynamic Analysis and Michael Ernst MIT CSAIL Page 1 Java Instrumentation Approaches Instrument source files Java Debug Interface (JDI) Instrument class files Page 2 Advantages

More information

Operating Systems 2230

Operating Systems 2230 Operating Systems 2230 Computer Science & Software Engineering Lecture 6: Memory Management Allocating Primary Memory to Processes The important task of allocating memory to processes, and efficiently

More information

Intel VTune Performance Analyzer 9.1 for Windows* In-Depth

Intel VTune Performance Analyzer 9.1 for Windows* In-Depth Intel VTune Performance Analyzer 9.1 for Windows* In-Depth Contents Deliver Faster Code...................................... 3 Optimize Multicore Performance...3 Highlights...............................................

More information

The Use of Traces in Optimization

The Use of Traces in Optimization The Use of Traces in Optimization by Borys Jan Bradel A thesis submitted in conformity with the requirements for the degree of Master of Applied Science Edward S. Rogers Sr. Department of Electrical and

More information

MethodHandle implemention tips and tricks

MethodHandle implemention tips and tricks MethodHandle implemention tips and tricks Dan Heidinga J9 VM Software Developer daniel_heidinga@ca.ibm.com J9 Virtual Machine 2011 IBM Corporation MethodHandles: a 30 sec introduction A method handle is

More information

CSc 453 Interpreters & Interpretation

CSc 453 Interpreters & Interpretation CSc 453 Interpreters & Interpretation Saumya Debray The University of Arizona Tucson Interpreters An interpreter is a program that executes another program. An interpreter implements a virtual machine,

More information

Seminar report Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE

Seminar report Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE A Seminar report On Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE SUBMITTED TO: www.studymafia.org SUBMITTED BY: www.studymafia.org 1 Acknowledgement I would like

More information

Atropos User s manual

Atropos User s manual Atropos User s manual Jan Lönnberg 22nd November 2010 1 Introduction Atropos is a visualisation tool intended to display information relevant to understanding the behaviour of concurrent Java programs,

More information

The Java Language Implementation

The Java Language Implementation CS 242 2012 The Java Language Implementation Reading Chapter 13, sections 13.4 and 13.5 Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches, pages 1 5. Outline Java virtual

More information

1. Introduction to the Common Language Infrastructure

1. Introduction to the Common Language Infrastructure Miller-CHP1.fm Page 1 Wednesday, September 24, 2003 1:50 PM to the Common Language Infrastructure The Common Language Infrastructure (CLI) is an International Standard that is the basis for creating execution

More information

Outline. CSC 447: Parallel Programming for Multi- Core and Cluster Systems

Outline. CSC 447: Parallel Programming for Multi- Core and Cluster Systems CSC 447: Parallel Programming for Multi- Core and Cluster Systems Performance Analysis Instructor: Haidar M. Harmanani Spring 2018 Outline Performance scalability Analytical performance measures Amdahl

More information

H.-S. Oh, B.-J. Kim, H.-K. Choi, S.-M. Moon. School of Electrical Engineering and Computer Science Seoul National University, Korea

H.-S. Oh, B.-J. Kim, H.-K. Choi, S.-M. Moon. School of Electrical Engineering and Computer Science Seoul National University, Korea H.-S. Oh, B.-J. Kim, H.-K. Choi, S.-M. Moon School of Electrical Engineering and Computer Science Seoul National University, Korea Android apps are programmed using Java Android uses DVM instead of JVM

More information

CE221 Programming in C++ Part 1 Introduction

CE221 Programming in C++ Part 1 Introduction CE221 Programming in C++ Part 1 Introduction 06/10/2017 CE221 Part 1 1 Module Schedule There are two lectures (Monday 13.00-13.50 and Tuesday 11.00-11.50) each week in the autumn term, and a 2-hour lab

More information

Compiler construction 2009

Compiler construction 2009 Compiler construction 2009 Lecture 3 JVM and optimization. A first look at optimization: Peephole optimization. A simple example A Java class public class A { public static int f (int x) { int r = 3; int

More information

Oak Intermediate Bytecodes

Oak Intermediate Bytecodes Oak Intermediate Bytecodes A summary of a paper for the ACM SIGPLAN Workshop on Intermediate Representations (IR 95) James Gosling 100 Hamilton Avenue 3rd floor Palo Alto CA 94301 Oak

More information

Mixed Mode Execution with Context Threading

Mixed Mode Execution with Context Threading Mixed Mode Execution with Context Threading Mathew Zaleski, Marc Berndl, Angela Demke Brown University of Toronto {matz,berndl,demke}@cs.toronto.edu (CASCON 2005, Oct 19/2005.) Overview Introduction Background:

More information

Symbol Tables Symbol Table: In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier in a program's source code is

More information

JamaicaVM Java for Embedded Realtime Systems

JamaicaVM Java for Embedded Realtime Systems JamaicaVM Java for Embedded Realtime Systems... bringing modern software development methods to safety critical applications Fridtjof Siebert, 25. Oktober 2001 1 Deeply embedded applications Examples:

More information

D Programming Language

D Programming Language Group 14 Muazam Ali Anil Ozdemir D Programming Language Introduction and Why D? It doesn t come with a religion this is written somewhere along the overview of D programming language. If you actually take

More information

Efficiency Gains in Inbound Data Warehouse Feed Implementation

Efficiency Gains in Inbound Data Warehouse Feed Implementation Efficiency Gains in Inbound Data Warehouse Feed Implementation Simon Eligulashvili simon.e@gamma-sys.com Introduction The task of building a data warehouse with the objective of making it a long-term strategic

More information

Administration CS 412/413. Why build a compiler? Compilers. Architectural independence. Source-to-source translator

Administration CS 412/413. Why build a compiler? Compilers. Architectural independence. Source-to-source translator CS 412/413 Introduction to Compilers and Translators Andrew Myers Cornell University Administration Design reports due Friday Current demo schedule on web page send mail with preferred times if you haven

More information

invokedynamic under the hood

invokedynamic under the hood Nadeesh T V ORACLE India Pvt Ltd 26 Aug 2016 Outline 1 JVM Languages 2 PreInvokedynamic 3 Invokedynamic 4 MethodHandle 5 Summary JVM Languages Languages which can run on Java Virtual Machine (JVM) Should

More information

JPROFILE102: A System for Experimental Analysis of Algorithms

JPROFILE102: A System for Experimental Analysis of Algorithms JPROFILE102: A System for Experimental Analysis of Algorithms Tanin Krajangthong and Somchai Prasitjutrakul Department of Computer Engineering Chulalongkorn University Bangkok, Thailand Abstract This paper

More information

SABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine p. 1

SABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine p. 1 SABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine David Bélanger dbelan2@cs.mcgill.ca Sable Research Group McGill University Montreal, QC January 28, 2004 SABLEJIT: A Retargetable

More information

Real Time: Understanding the Trade-offs Between Determinism and Throughput

Real Time: Understanding the Trade-offs Between Determinism and Throughput Real Time: Understanding the Trade-offs Between Determinism and Throughput Roland Westrelin, Java Real-Time Engineering, Brian Doherty, Java Performance Engineering, Sun Microsystems, Inc TS-5609 Learn

More information

Program Dynamic Analysis. Overview

Program Dynamic Analysis. Overview Program Dynamic Analysis Overview Dynamic Analysis JVM & Java Bytecode [2] A Java bytecode engineering library: ASM [1] 2 1 What is dynamic analysis? [3] The investigation of the properties of a running

More information

3/15/18. Overview. Program Dynamic Analysis. What is dynamic analysis? [3] Why dynamic analysis? Why dynamic analysis? [3]

3/15/18. Overview. Program Dynamic Analysis. What is dynamic analysis? [3] Why dynamic analysis? Why dynamic analysis? [3] Overview Program Dynamic Analysis Dynamic Analysis JVM & Java Bytecode [2] A Java bytecode engineering library: ASM [1] 2 What is dynamic analysis? [3] The investigation of the properties of a running

More information

Performance Profiling. Curtin University of Technology Department of Computing

Performance Profiling. Curtin University of Technology Department of Computing Performance Profiling Curtin University of Technology Department of Computing Objectives To develop a strategy to characterise the performance of Java applications benchmark to compare algorithm choices

More information

VM instruction formats. Bytecode translator

VM instruction formats. Bytecode translator Implementing an Ecient Java Interpreter David Gregg 1, M. Anton Ertl 2 and Andreas Krall 2 1 Department of Computer Science, Trinity College, Dublin 2, Ireland. David.Gregg@cs.tcd.ie 2 Institut fur Computersprachen,

More information

Soot A Java Bytecode Optimization Framework. Sable Research Group School of Computer Science McGill University

Soot A Java Bytecode Optimization Framework. Sable Research Group School of Computer Science McGill University Soot A Java Bytecode Optimization Framework Sable Research Group School of Computer Science McGill University Goal Provide a Java framework for optimizing and annotating bytecode provide a set of API s

More information

Dynamic Race Detection with LLVM Compiler

Dynamic Race Detection with LLVM Compiler Dynamic Race Detection with LLVM Compiler Compile-time instrumentation for ThreadSanitizer Konstantin Serebryany, Alexander Potapenko, Timur Iskhodzhanov, and Dmitriy Vyukov OOO Google, 7 Balchug st.,

More information

InsECTJ: A Generic Instrumentation Framework for Collecting Dynamic Information within Eclipse

InsECTJ: A Generic Instrumentation Framework for Collecting Dynamic Information within Eclipse InsECTJ: A Generic Instrumentation Framework for Collecting Dynamic Information within Eclipse Arjan Seesing and Alessandro Orso College of Computing Georgia Institute of Technology a.c.seesing@ewi.tudelft.nl,

More information

An analysis of object-based intelligent image

An analysis of object-based intelligent image An analysis of object-based intelligent image processing and retrieval system Abstract-In order to improve the process of analysis and retrieval of images, it is necessary to examine the execution of such

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

Sista: Improving Cog s JIT performance. Clément Béra

Sista: Improving Cog s JIT performance. Clément Béra Sista: Improving Cog s JIT performance Clément Béra Main people involved in Sista Eliot Miranda Over 30 years experience in Smalltalk VM Clément Béra 2 years engineer in the Pharo team Phd student starting

More information

Debugging Tools for MIDP Java Devices

Debugging Tools for MIDP Java Devices Debugging Tools for MIDP Java Devices Olli Kallioinen 1 and Tommi Mikkonen 2 1 Sasken Finland, Tampere, Finland olli.kallioinen@sasken.com 2 Tampere University of Technology, Tampere, Finland tommi.mikkonen@tut.fi

More information

Context Threading: A flexible and efficient dispatch technique for virtual machine interpreters

Context Threading: A flexible and efficient dispatch technique for virtual machine interpreters : A flexible and efficient dispatch technique for virtual machine interpreters Marc Berndl Benjamin Vitale Mathew Zaleski Angela Demke Brown Research supported by IBM CAS, NSERC, CITO 1 Interpreter performance

More information

Develop Unified SNMP, XML, CLI, and Web-based Management for Embedded Real-Time Systems with MIBGuide

Develop Unified SNMP, XML, CLI, and Web-based Management for Embedded Real-Time Systems with MIBGuide 1 Overview Develop Unified SNMP, XML, CLI, and Web-based Management for Embedded Real-Time Systems with MIBGuide SNMP Research International, Inc. Knoxville, Tennessee 1 Overview Support for remote management

More information

Java TM. Multi-Dispatch in the. Virtual Machine: Design and Implementation. Computing Science University of Saskatchewan

Java TM. Multi-Dispatch in the. Virtual Machine: Design and Implementation. Computing Science University of Saskatchewan Multi-Dispatch in the Java TM Virtual Machine: Design and Implementation Computing Science University of Saskatchewan Chris Dutchyn (dutchyn@cs.ualberta.ca) September 22, 08 Multi-Dispatch in the Java

More information

Visual Amortization Analysis of Recompilation Strategies

Visual Amortization Analysis of Recompilation Strategies 2010 14th International Information Conference Visualisation Information Visualisation Visual Amortization Analysis of Recompilation Strategies Stephan Zimmer and Stephan Diehl (Authors) Computer Science

More information

Interaction of JVM with x86, Sparc and MIPS

Interaction of JVM with x86, Sparc and MIPS Interaction of JVM with x86, Sparc and MIPS Sasikanth Avancha, Dipanjan Chakraborty, Dhiral Gada, Tapan Kamdar {savanc1, dchakr1, dgada1, kamdar}@cs.umbc.edu Department of Computer Science and Electrical

More information

Foundations of Software Engineering

Foundations of Software Engineering Foundations of Software Engineering Dynamic Analysis Christian Kästner 1 15-313 Software Engineering Adminstrativa Midterm Participation Midsemester grades 2 15-313 Software Engineering How are we doing?

More information

SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE

SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE 1 SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE Tatsuya Hagino hagino@sfc.keio.ac.jp slides URL https://vu5.sfc.keio.ac.jp/sa/ Java Programming Language Java Introduced in 1995 Object-oriented programming

More information

A Closer Look at Fedora s Ingest Performance

A Closer Look at Fedora s Ingest Performance A Closer Look at Fedora s Ingest Performance Kai Strnad, Matthias Razum kai.strnad@fiz karlsruhe.de, matthias.razum@fiz karlsruhe.de FIZ Karlsruhe Development and Applied Research Germany Motivation It

More information

Volume II, Section 5 Table of Contents

Volume II, Section 5 Table of Contents Volume II, Section 5 Table of Contents 5...5-1 5.1 Scope...5-1 5.2 Basis of...5-1 5.3 Initial Review of Documentation...5-2 5.4 Source Code Review...5-2 5.4.1 Control Constructs...5-3 5.4.1.1 Replacement

More information

Extended Dataflow Model For Automated Parallel Execution Of Algorithms

Extended Dataflow Model For Automated Parallel Execution Of Algorithms Extended Dataflow Model For Automated Parallel Execution Of Algorithms Maik Schumann, Jörg Bargenda, Edgar Reetz and Gerhard Linß Department of Quality Assurance and Industrial Image Processing Ilmenau

More information

Improving the efficiency of adaptive middleware based on dynamic AOP

Improving the efficiency of adaptive middleware based on dynamic AOP Improving the efficiency of adaptive middleware based on dynamic AOP Angela Nicoară, Johann Gyger, Gustavo Alonso Department of Computer Science Swiss Federal Institut of Technology Zürich CH-8092 Zürich,

More information

On the Algorithm for Specializing Java Programs with Generic Types

On the Algorithm for Specializing Java Programs with Generic Types On the Algorithm for Specializing Java Programs with Generic Types Daniel Selifonov, Nathan Dahlberg, Elena Machkasova Computer Science Discipline University of Minnesota Morris Morris MN, 56267 selif004,dahlb061,elenam@umn.edu

More information

Project. there are a couple of 3 person teams. a new drop with new type checking is coming. regroup or see me or forever hold your peace

Project. there are a couple of 3 person teams. a new drop with new type checking is coming. regroup or see me or forever hold your peace Project there are a couple of 3 person teams regroup or see me or forever hold your peace a new drop with new type checking is coming using it is optional 1 Compiler Architecture source code Now we jump

More information

JAVA PERFORMANCE. PR SW2 S18 Dr. Prähofer DI Leopoldseder

JAVA PERFORMANCE. PR SW2 S18 Dr. Prähofer DI Leopoldseder JAVA PERFORMANCE PR SW2 S18 Dr. Prähofer DI Leopoldseder OUTLINE 1. What is performance? 1. Benchmarking 2. What is Java performance? 1. Interpreter vs JIT 3. Tools to measure performance 4. Memory Performance

More information

A Type System for Object Initialization In the Java TM Bytecode Language

A Type System for Object Initialization In the Java TM Bytecode Language Electronic Notes in Theoretical Computer Science 10 (1998) URL: http://www.elsevier.nl/locate/entcs/volume10.html 7 pages A Type System for Object Initialization In the Java TM Bytecode Language Stephen

More information

NetBeans IDE Field Guide

NetBeans IDE Field Guide NetBeans IDE Field Guide Copyright 2004 Sun Microsystems, Inc. All rights reserved. Debugging Java Applications Table of Contents Starting a Debugging Session...2 Debugger Windows...3 Attaching the Debugger

More information

Introduction to Java Programming

Introduction to Java Programming Introduction to Java Programming Lecture 1 CGS 3416 Spring 2017 1/9/2017 Main Components of a computer CPU - Central Processing Unit: The brain of the computer ISA - Instruction Set Architecture: the specific

More information

The Encoding Complexity of Network Coding

The Encoding Complexity of Network Coding The Encoding Complexity of Network Coding Michael Langberg Alexander Sprintson Jehoshua Bruck California Institute of Technology Email: mikel,spalex,bruck @caltech.edu Abstract In the multicast network

More information

The NetRexx Interpreter

The NetRexx Interpreter The NetRexx Interpreter http://www2.hursley.ibm.com/netrexx/ RexxLA / WarpTech -- 26 May 2000 Mike Cowlishaw IBM Fellow mfc@uk.ibm.com netrexxi Overview Introduction to NetRexx Demo. -- compiling and interpreting

More information

Why GC is eating all my CPU? Aprof - Java Memory Allocation Profiler Roman Elizarov, Devexperts Joker Conference, St.

Why GC is eating all my CPU? Aprof - Java Memory Allocation Profiler Roman Elizarov, Devexperts Joker Conference, St. Why GC is eating all my CPU? Aprof - Java Memory Allocation Profiler Roman Elizarov, Devexperts Joker Conference, St. Petersburg, 2014 Java Memory Allocation Profiler Why it is needed? When to use it?

More information

Proposal To Include Java. As A Language For The IOI.

Proposal To Include Java. As A Language For The IOI. Proposal To Include Java As A Language For The IOI. The following proposal for the inclusion of Java as a new language for the IOI competition is made in the light that the technical difficulties that

More information

Project 3 Due October 21, 2015, 11:59:59pm

Project 3 Due October 21, 2015, 11:59:59pm Project 3 Due October 21, 2015, 11:59:59pm 1 Introduction In this project, you will implement RubeVM, a virtual machine for a simple bytecode language. Later in the semester, you will compile Rube (a simplified

More information

Agent-Enabling Transformation of E-Commerce Portals with Web Services

Agent-Enabling Transformation of E-Commerce Portals with Web Services Agent-Enabling Transformation of E-Commerce Portals with Web Services Dr. David B. Ulmer CTO Sotheby s New York, NY 10021, USA Dr. Lixin Tao Professor Pace University Pleasantville, NY 10570, USA Abstract:

More information

Thread Affinity Experiments

Thread Affinity Experiments Thread Affinity Experiments Power implications on Exynos Introduction The LPGPU2 Profiling Tool and API provide support for CPU thread affinity locking and logging, and although this functionality is not

More information

Short-term Memory for Self-collecting Mutators. Martin Aigner, Andreas Haas, Christoph Kirsch, Ana Sokolova Universität Salzburg

Short-term Memory for Self-collecting Mutators. Martin Aigner, Andreas Haas, Christoph Kirsch, Ana Sokolova Universität Salzburg Short-term Memory for Self-collecting Mutators Martin Aigner, Andreas Haas, Christoph Kirsch, Ana Sokolova Universität Salzburg CHESS Seminar, UC Berkeley, September 2010 Heap Management explicit heap

More information