An Energy Consumption Model for Java Virtual Machine

Size: px
Start display at page:

Download "An Energy Consumption Model for Java Virtual Machine"

Transcription

1 An Energy Consumption Model for Java Virtual Machine Sébastien Lafond Johan Lilius Åbo Akademi University, Department of Computer Science, Lemminkäisenkatu 14A, FIN Turku, Finland Turku Centre for Computer Science TUCS Technical Report No 597 March 2004 ISBN ISSN

2 Abstract In recent years we have seen an explosion of markets for portable electronic devices such as PDAs, personal communicators and mobile phones. The size and complexity of applications, but also development constraints like getting the product to market on time make the use of high-level languages like Java necessary. Java 2 Micro Edition (J2ME) has emerged as a good solution for developing applications on those platforms. The main goal of Java language is to allow applications development with an abstraction of the target platform, making the concept write once, run it anywhere possible. The Java Virtual machine (JVM) is an abstract machine, making the interface between platform independent applications and the hardware, through a possible operating system. Thus the use of Java language can be seen as adding one more layer, the Java virtual machine, between the hardware and software layers. In this paper we establish a general framework for estimating the energy consumption of an embedded Java virtual machine. We have designed a number of experiments to find the constants overhead of the Virtual Machine and establish energy consumption cost for individual Java Opcodes. The results show that there is a basic constant overhead that is equal for every Java program, and a that a subset of Java opcodes have an almost constant energy cost. We also show that memory access is a crucial energy consumption component. Keywords: Java virtual machine, KVM, energy comsumption, opcode, bytecode TUCS Laboratory Embedded Systems Laboratory

3 Contents 1 Introduction 2 2 Energy Distribution in Handheld Devices Definitions Solutions for low power systems An energy consumption model of Java applications Measurements methodology KVM enprofiler Experiments First experiment Second experiment Third experiment Other experiments Java opcode energy cost Measurements methodology Results Conclusion 19 A Annex 23 1

4 1 Introduction In recent years we have seen an explosion of markets for portable electronic devices such as PDAs, personal communicators and mobile phones. These batteryoperated devices provide more and more functionalities and as a consequence become more and more complex. They have in common strong constraints on energy consumption, and thus maximizing battery life for such devices is crucial. Several techniques have been developed to optimize the energy consumption of embedded systems. Those techniques can be hardware based solutions, as well as software or co-design solutions [1]. Until now, techniques for low power optimization of software have been mostly applied on processor instructions level [2, 3, 4] by using principally processor specific instructions [5, 6]. Techniques on memory management have also been widely applied for optimizing energy consumption [7, 8, 9, 10]. Manufacturers have now understood the fact that software optimization for lower energy consumption is an important issue. A typical example is the story of the Siemens C25 "power" [11]. The size and complexity of applications, but also development constraints like getting the product to market on time make the use of high-level languages like Java necessary. Java 2 Micro Edition (J2ME) has emerged as a good solution for developing applications on those platforms. Due to the wide diversity of hardware and OS used in the world of handheld devices, portability across systems is not easy and needs efforts. Java technology makes it possible to develop applications, usable by a range of different systems and platforms, without having to worry about portability. We can easily predict that developer communities and companies will more and more provide Java applications for such handheld devices, to satisfy an increasing demand. But fewer studies have been done on energy consumption from the virtual machine level. The study of energy consumption of Java applications is needed to build an energy consumption model of the virtual machine. This model will be use to quantify the energy needed by the applications. 2 Energy Distribution in Handheld Devices We mostly know problems related to power dissipation through the noisy fans and the more and more sophisticated cooling systems that need to be installed on modern PC processors. As the number of transistors integrated on one chip increased, the power dissipation follows the same trend. For an Intel Pentuim IV on 90 process the power dissipation can reach 115 watts and drain up to 91 amperes through its 86 processor supply voltage pins. But as soon as a system require being mobile and autonomous those extreme values make a Pentuim IV 2

5 2 I Dipole U Figure 1: Convention for current and voltage notation for a dipole in a DC circuit unusable over standard batteries characteristics. For such system giving consideration to its energy consumption is crucial, so we will look in this section at basic concepts about electrical power and energy and review different solution for low power systems. 2.1 Definitions Using the current and voltage notation convention as show in figure 1, we can define the instantaneous power for a dipole in a direct current (DC) circuit as the following : where is the instantaneous power in Watt (W) dissipated by one dipole at time, the potential difference in Volt (V) across his inputs at time, and the current in Ampere (A) passing through the dipole at time. The average power dissipated by one dipole between the time and! in Watt, is defined by : " #!$% &('*) ',+ -.0/1 where the function of the potential difference in Volt across his inputs, and the function of the current in Ampere passing through the dipole. The energy 2, in Joule (J), consumed by one dipole between the time 3 and! is defined by : &('*) ',+ -.0/1 The energy is a measure of power expended over time. In other words one Joule is equivalent to one watt dissipated or radiated during one second. The misuses of terms Energy and Power in the literatures have often lead to confusion. In this document we will try to respect their definitions, with only one 3

6 8 Power Energy consumed E 1 Time t 0 t 1 t 0 t 1 Time Figure 2: System A - Power dissipation and energy consumed Power Energy consumed E' 1 t 0 t Time 1 t 0 t 1 Time Figure 3: System B - Power dissipation and energy consumed exception concerning the term "low power" which already has been adopted by the community as meaning "low average power". 2.2 Solutions for low power systems In order to extend the battery life of an handheld device two solutions can be applied: increase the amount of energy embedded in the device, or decrease its energy consumption. Much effort has been put into increasing the batteries capacity, but solutions are costly in terms of price, volume and weight [12]. Therefore the attention has been turn to develop so called Low Power Systems. Energy saving can be obtained by specific hardware implementations and, or, by techniques for low power optimization of software [13]. In this section we will look at system level and software solutions that can be applied once the hardware implementation has been defined. The power dissipated by one CMOS component is proportional to the square of its supply voltage 4565, to his frequency 7 in Hertz (Hz), its lumped capacitance 8 in Farad (F), its activity factor 9 and its leakage current ;: : " 9=< <>7?<>4 565A@ 4B565C< 4 D:-

7 8 D: where 4B565C< represent the static power (dissipated due to the leakage current), and 9=< <>7E<F4 565 the dynamic power dissipated by the CMOS circuit. We can see that decreasing the supply voltage will have a quadratic impact on the energy consumption, as the dynamic power is proportional to the square of the supply voltage. Historically the power supply of processors was 5V, but nowadays the most common value is 1.2V. However decreasing the supply voltage is not indefinitely possible, as it require to also decreasing the processor process technology. But reducing the process technology causes itself an increasing leakage current [14] and thus increase the energy consumed due to the static power dissipation. This means that efficient techniques for reducing energy consumption will have also to deal with the static as well as the dynamic power dissipated by a CMOS circuit. System level solutions are based on hardware & software collaboration to achieve energy consumption reductions. They all have in common that they reduce energy consumption regardless of the instantaneous power dissipation. Indeed, a system can from time-to-time have a relatively high instantaneous power dissipation and still be described as a low power system, i.e. having a low average power dissipation. Figures 2 and 3 describes this example where System A will HJI LK consume less energy during the period G than the system B, as system A has a lower average power dissipation than system B. If both systems perform the same task and satisfy the same requirements, system A should be chosen to save energy. The deactivation of peripherals, or parts of these, during their idle time is certainly the most common technique for reducing system energy consumption. It implies to define power management policies that will decide whether to put a periphery in a determined sleep mode or not. Most policies are based on the idle time already spent by the peripherals but a policy can also use prediction algorithms. It s generally the operating system (OS) that will handle these policies, as the OS has a more global view of the system activities than each individual peripheral. Nevertheless, applications running on the system can have unpredictable behaviors, mainly through user interfaces. Too aggressive power management policies can also deteriorate the system performance and make it inefficient. Matching the processor throughput with the current workload while dynamically scaling down the processor frequency can also achieve energy saving. The frequency of a CMOS processor is proportional to its supply voltage as it drives propagation delays and transition times. Thus reducing the processor frequency makes it possible to also decrease the processor supply voltage and gain quadratic energy saving. Figure 4 shows the relation between frequency and voltage on a ARM926EJ-S processor core and figure 5 shows the possible energy saving obtainable through dynamic voltage and frequency scaling (DVS) [15]. The efficiency of DVS is based on the algorithm used to determine the optimized frequency and voltage suitable for the current workload. Algorithms for DVS have 5

8 Vcore (V) Measured Vcc Vcc + safety margin Frequency (MHz) Figure 4: Voltage vs. frequency for ARM296EJ-S processor 100% 80% Energy use 60% 40% 20% 0% Frequency (MHz) Figure 5: Energy used vs. frequency for ARM296EJ-S processor 6

9 been an active research area, and several solutions have been proposed [16, 17, 18, 19]. But the need for fully software optimization when system level solutions are not available and, or, hardware knowledge is missing. A processor instruction level power analysis model has been developed in [20, 21] where a base cost for each instruction and an overhead costs between adjacent instructions was measured. This model is used to evaluate the energy reduction that can be achieved thanks to software optimization. They are mainly based on the fact that the more instructions a processor has to execute, the more energy it will consume. As a result, techniques for low power optimization of software will require the same analysis and use the same solutions that are used to execution time optimization. By unrolling loops from the executed code, i.e. replicating the body of a loop k times and increase the loop counter with k, we can reduce the loop overheads, remove branch instructions and also have more opportunities for instruction scheduling. In a similar way, inlining procedures (also called in-line expansion), i.e. replacing a function call by the body of the function, allow the elimination of the overhead of the function call, and improves possibilities for compiler analysis and optimization. But both optimizations have the disadvantage of increasing the code size, and thus one needs to trade off energy reduction against memory size. All the more so, as bigger memory requirements will have as a consequence to increase the static energy consumption. For some applications, and depending on the architecture, it might be possible to have hand optimization, particularly if the application is small. As shows in[22], the use of register operands instead of memory operands thanks to an optimal register allocation can lead to a 40% energy consumption reduction. In [23] the use of the specific instruction LAB, which allows loading two registers in one cycle, brings up to 50% of reduction by comparison with two MOV instructions. These two last examples show us the importance of the fact that the compiler uses all capabilities of an architecture. 3 An energy consumption model of Java applications The main goal of the Java language is to allow the development of applications with an abstraction of the target platform, making the concept write once, run it anywhere possible. The Java Virtual machine (JVM) is an abstract machine, making the interface between platform independent applications and the hardware, through a possible operating system. Thus the use of Java language can be seen as adding one more layer, the Java virtual machine, between the hardware 7

10 Start JVM Initialization of the VM Load the class containing the main method Interpreter loop Exit Figure 6: Simple view of the JVM life cycle and software layers. As it has been done for processor instructions, it would be interesting to see how well applying estimation and optimization techniques on the virtual machine opcodes level can be done. Figure 6 shows a simple view of the JVM life cycle. An efficient energy model should characterize each stage of the life cycle model, and thus show in which stage(s) effort need to be concentrated to achieve energy optimization. It seems obvious that such model need to consider the system s hardware and software configurations and therefore is not directly portable. But the methodology used to build it can easily be applied on different configurations. As show in [24] the memory consumption must also be included in the model, as the memory might represent the biggest source of energy consumption on a typical embedded system. This is even more important to take into account as the JVM is a stack machine and will therefore have a relatively high memory activity. In addition, it will also be interesting to look at the cost differences between the two possible Java code execution modes: interpreted or just in time (JIT) compilation. JIT compilation increases significantly the execution speed, but in the same time increase memory footprint. A trade-off between time execution and memory footprint size will certainly have to be found to reach the optimum optimization point for energy consumption. 3.1 Measurements methodology We chose the Sun Microsystems K Virtual Machine (KVM), CLDC v1.0.3, as it has been developed for resource-constrained platform and has its source code freely available. KVM is a small virtual machine containing about Kb of object code in its standard configuration and has a Kb total memory footprint size depending of the application running on it. KVM can run on a 16-bit or 32-bit RISC/CISC processors clocked from 25MHz. To build an energy model of the KVM we modified the energy profiler enprofiler [25] developed by the Embedded Systems Groups at Dortmund University. Enprofiler is a processor instructions level energy profiler for ARM7TDMI processor cores operating in Thumb [26] mode and integrating the consumption of memory accesses. It has been built from physical measurements done on an Atmel AT91EB01 evaluation board consisting of a AT91M40400 processor cloked 8

11 at 33MHz, an external 512K bytes 16-bits SRAM, an external 128K bytes 16-bits Flash memory and several other peripherals. A detailed description of the energy model used by enprofiler is given in [27]. The Thumb instruction set is a subset of the most common 32 bit ARM instruction compressed into 16 bit opcodes which allows on average a 30% code density reduction in comparison to the corresponding ARM code. Thumb instruction set is used on system where cost and energy consumption are important factors, as Thumb code requires smaller memory and will be on average 45% faster than ARM code with 16-bit memory. Figure 7 shows the measurements methodology scheme used to characterize each stage of the KVM life cycle. The Java class generator generates, from template classes, Java applications with the possibility to modify parameters inside the class source code. Thanks to the Java to C translator JCC we compile and link together the JVM source code and the generated Java application. The executable code is run on the ARM7TDMI emulator ARMulator, which trace instructions, memory accesses and events that occur during the application execution. From this trace we extract all information concerning the memory size, type (read, write, sequential, non-sequential) and access address, the instructions address and their opcode. The energy profiler read the emulator trace as well as an instruction energy consumption database providing processor instruction costs, and an energy consumption database providing the cost of a memory access depending of its address, size and type. The energy profiler estimate the energy consumed by the application and provide information on how the energy is distributed between the processor and memories for each KVM stage. The main steps of this scheme are as the following: 9

12 M M M Java Class generator Java Application (source code) Java Virtual Machine (Source code) Java Code Compact (JCC) Energy consumption per instruction Compiler & Linker Energy profiler Executable (Application + VM) Platform data (memory mapping) Processor Emulator (ARM7TDMI) Processor trace file : Memory - Instruction Event - Register - Bus Battery specification Energy Max. running time of the application Figure 7: General measurements methodology scheme KVM enprofiler KVM enprofiler analyzes 4 input files, and provide details about the energy consumed by the application. It will provide the number of instructions, memory access and garbage collections that occur during the execution. From the linker we collect few useful symbols and their address in order to provide the energy consumed by different stages of the KVM. The eight symbols used are : main: this symbol represent the main() function of KVM, and is used by the KVM enprofiler to detect the start of the KVM execution. StartJVM: this symbol represent the StartJVM(argc, argv) function (in StartJVM.c source file). This function only checks if the user gave a class name as argument, and then calls the KVM_Start() function. KVM_Start: this symbol represent the KVM_Start() function (in StartJVM.c source file). This function initializes the VM, the global variables, the profiling variables, the memory system, the hashtable, the class loading interface, the Java system classes, the class file verifier and the event handling system. It also initializes the multithreading system after loading the main application class. Just before calling the Interpreter it pushs into the Java stack the classes JavaLangOutOfMemoryError, JavaLangSystem, JavaLangString, JavaLangThread and JavaLangClass. In this way the JavaLang- Class is the first class that is initialized. 10

13 M M M M M garbagecollect: this symbol represent the garbagecollect function (in garbage.c source file) that performs mark-and-sweep garbage collection. ExitGarbage : the ExitGarbage symbol has been added to the KVM source code to detect the end of the garbage collector in the KVM enprofiler. Interpret : this symbol represent the Interpret() function (in execute.c source file) that runs the interpreter loop. KVM_Cleanup : KVM_Cleanup represent the KVM_Cleanup() function (in StartJVM.c source file). It runs several finalization functions of the system when the VM is shut down. ExitVM : This symbol is used by the KVM enprofiler to detect the end of the KVM execution. The KVM enprofiler need as inputs: 1. An instruction energy consumption database providing processor instruction cost. 2. A memory energy consumption database providing the energy consumption of a memory access depending of its address, size and type. 3. The processor trace file 4. A file generated by the linker providing all needed symbols and their address. 4 Experiments We run the measurement process over a set of small and basic applications to characterize each stage of the KVM life cycle and see if some stages are dominant over others. 4.1 First experiment The first application tested, see figure 8, is an application that does absolutely nothing. We run it through the KVM enprofiler in order to find out if overhead constants in the energy consumption can be determined. We can predict that one or several stage(s), like StartJVM, will have constant energy consumption, as they are application independent. The results are given in figure 9. 11

14 public class HelloWorld { public static void main(string arg[]){ { //nothing to do... } } Figure 8: First experiment - The Empty application 9.80% Energy distribution 4.48% 7.13% 3.33% Memory / Instructions distribution 24.69% 21.24% StartJVM Inst StartJVM Mem KVM Start Inst KVM Start Mem Interpret Inst Interpret Mem KVM Clean Instr KVM Clean Mem Garbage Inst Garbage Mem Memory Instructions 49.46% 75.31% Figure 9: First experiment - Energy consumption distributions From figure 9 we can already make some remarks. Even if this application does absolutely nothing, the Interpreter stage represent about 70 % of the energy consumed, and the memory access represent the principal source of energy consumption, at 75% of the total energy consumed. We can also note that the KVM automatically launch one garbage collection just before starting to interpret the class file(s). Thus for each application tested at least one garbage collection will consume energy. 4.2 Second experiment The second experiment runs a Java class, see figure 10, that instantiates several objects of class MyClass. This class doesn t contain any fields and has just one main method. Each new class MyClass created by main is stored in the heap, and will contain only a reference to the class definitions area. Each instantiation will create a new stack frame and call the MyClass constructor. This constructor calls the java/lang/object constructor method and creates a second new stack frame. The stack frame created by the main method contains two operand stacks and three local variables to store the length and the loop index. From the energy consumption graph in figure 10 we note that only the energy consumed by the interpreter is dependent on the loop length value. All other stages of the KVM consume a constant energy including the garbage collector, as the maximum number of created object was not enough to fill up the Java heap 12

15 public class MyClass { public static void main(string arg[]) { int n = X; for(int i=0;i<=n;i++) { new MyClass(); } } } Energy consumption in uj Energy Consumption Length of the loop StartJVM Inst StartJVM Mem KVM Start Inst KVM Start Mem Interpret Inst Interpret Mem KVM Clean Instr KVM Clean Mem Garbage Inst Garbage Mem Figure 10: Second experiment - Class file source code and loop length effect on energy consumption... 4 goto 18 7 new #2 -> create a new MyClass object in the heap 10 dup - > duplicate the reference of the new object in the operand stack 11 invokespecial #3 -> call the constructor 14 pop -> remove the top of the operand stack 17 iinc 2 1 -> increment the second local variable by 1 18 iload_2 -> load the second local variable in the operand stack (i) 19 iload_1 - > load the first local variable in the operand stack (length) 20 if_icmple Figure 11: Second experiment - Java opcodes corresponding to the for loop and trigger off a garbage collection. It is also important to notice that the energy consumed by the interpreter stage is linear and proportional to the loop length. This can be explain by the fact that the interpreter is looping over a number of constant Java opcodes, see figure 11. The KVM enprofiler evaluate the cost of memory access according to the memory technology, i.e. have for each memory type (RAM, ROM, Flash, etc.) an average cost for each access type regardless of its address. As the new opcode allocates the same amount of memory for all objects created, it will have an identical cost for each execution. The energy distribution for a loop length of 1000, see figure 12, is similar to the first experiment with an interpreter stage even more dominant, representing over 95% of the total energy consumed. If we compare the numerical values of StartJVM, KVM_Start and KVM_Clean stages with the one obtained during the first experiment, we note that they are identical. This shows that constant overhead 13

16 Memory/Instructions Distribution 29.93% Instructions Memory 28.59% Energy Distribution 1.42% StartJVM Inst StartJVM Mem KVM Start Inst KVM Start Mem Interpret Inst Interpret Mem KVM Clean Instr KVM Clean Mem Garbage Inst Garbage Mem 70.07% 67.16% Figure 12: Second experiment - Energy distribution for a loop length equal to 1000 costs can be define for some of the KVM stages, as they behave independently from the Java application running on KVM. 4.3 Third experiment The third experiment runs a Java class which implements a basic arithmetic operation, see figure 13 for the class source code. In figure 14 the distribution of energy consumed by processor instructions and memory access is identical to the one obtained during the second experiment. This observation suggests that running an arithmetic operation or object instantiation dominant application will not influence the energy distribution between processor instructions and memory access. The consumed energy distribution is also similar to the preceding one with the overall interpreter stage contribution lightly lower at 85%. This difference is explained by the lower energy value consumed to interpret this third Java class. As some other stages seem to have a constant energy consumption, the interpreter stage size decrease in the energy distribution. Figure 15 shows the relation between the energy consumed by the application and the loop length. The graph is similar to the precedent one with constant values for all stages except for the interpreter. For the same reasons as experiment 2, the energy consumed by the interpreter is linear in the loop length. But its instruction and memory slopes are about five times lower as the Java opcodes needed to increment one integer consume less energy than the one needed to instantiate one MyClass object. 4.4 Other experiments We run numerous other Java classes through the KVM enprofiler and all observations on their results were similar to one described above. That is, some KVM 14

17 public class MyClass2 { public static void main(string arg[]) { int length = X; int i=0; for(int number=0;number<=length;number++) { i++; } } } Figure 13: Third experiment - Java class source code Memory / Instructions Distribution 30.01% Instructions Memory 25.65% Energy Distribution 3.39% 1.58% StartJVM Inst StartJVM Mem KVM Start Inst KVM Start Mem Interpret Inst Interpret Mem KVM Clean Instr KVM Clean Mem Garbage Inst Garbage Mem 69.99% 60.48% Figure 14: Third Experiment - Energy Distribution for loop length equal to Energy Consumption Energy consumtion in uj Length of the loop StartJVM Inst StartJVM Mem KVM Start Inst KVM Start Mem Interpret Inst Interpret Mem KVM Clean Instr KVM Clean Mem Garbage Inst Garbage Mem Figure 15: Third Experiment - Energy Consumption vs Loop Lenght 15

18 StartJVM Inst. StartJVM Mem. KVMStart Inst. KVMStart Mem KVM Clean Inst. KVMClean Mem 89,2 210,94 748, ,18 144,92 326,38 Interpreter Inst. Interpreter Mem Table 1: KVM Energy Consumption Overhead in NPO stages consume a constant amount of energy independently of the Java application running on it. Table 1 shows the three constant stages and their energy consumptions due to respectively processor instructions execution and memory access. In addition, from the first experiment we can define the interpreter overhead cost, as it didn t have to interpret any Java opcode from the main class method. For all experiments done the total energy consumption follows the same distribution scheme that is 70% of the energy is consumed by memories access and 30% by processor instructions execution. The energy consumption of each KVM stage respects also the same distribution. The garbage collection energy consumption is a very interesting topic and would need further exploration of all variables needed to characterize it. Several factors can influence the garbage collection behavior and thus its energy consumption: the size of the heap, the sizes and numbers of live or dead objects, and heap fragmentation. However, as shown on figure 16, the garbage collection stage will hardly exceed more than 10% of the total energy consumed by an application running on KVM. Figure 16 shows the energy distribution of a small Java class which instantiate new objects in a loop. Each object size is approximatively 2Kb. Thus for a 128Kb heap size and a loop length of 1000 the garbage collector needs to be triggered 16 times to reclaim the heap space occupied by unreferenced objects created by the loop. Table 2 shows the energy values consumed by the interpreter and garbage collector for a loop length of From all experiments done it is clear that the interpreter stage is far ahead the main source of energy consumption and a better comprehension of it is needed if someone wants to achieve energy optimization on the KVM. As the interpreter reads and executes the Java bytecode, having a closer view of the interpreter implies increasing the granularity of its energy consumption model by looking at the cost of each Java opcode interpreted. 4.5 Java opcode energy cost In order to get a better interpreter s energy consumption understanding an evaluation of each Java opcode energy cost is needed. As a strict class file structure 16

19 public class HelloWorld { int[] tab = new int[500]; public static void main(string arg[]){ int length = X; for(int number=0;number<=lenght;number++) { new HelloWorld(); } } 25.73% Energy Distribution 8.12% 3.71% StartJVM Inst StartJVM Mem KVM Start Inst KVM Start Mem Interpret Inst Interpret Mem KVM Clean Instr KVM Clean Mem Garbage Inst Garbage Mem } 60.94% Figure 16: Garbage collection weight in energy distribution Interpreter Inst. Interpreter Mem. Garbage Collect. Inst. Garbage Collect. Mem Table 2: Energy consumption values for a loop length of 1000 innpo needs to be respected, it is not possible to only execute one Java opcode. Thus a costs comparison between two class files is needed to estimate the difference cost between them. The general measurements methodology scheme used to characterize each KVM stage life cycle can be re-used with different input. Instead of using Java application source code files we will use as input appropriate byte-code executable class files Measurements methodology Figure 17 shows an abstract view of the class files generator used to create two class files, named ClassFile and ClassFile_Ref, from which energy cost will be compared. The opcode behavior towards the Java operand stack and the local variables array has to be defined for each studied Java opcode, i.e. provide the operand stack state needed before and resulting after the studied opcode execution as well as the number of local variables needed. Figure 18 shows an example of generated bytecode classes for the Java opcode NOP (0x00). In this example ClassFile s method 1, the main method, executes 256 NOP opcodes when the ClassFile_Ref s method 1 executes only the compulsory return opcode in order to return void from the main method. By comparing the interpreter s energy consumption for both class files we can get the energy consumption estimation for 256 NOP executions and thus the energy cost of one NOP opcode. To ensure the estimation quality for each opcode we generate several pairs of class files executing 17

20 Java class file generator Opcode + (argument) Opcode behavior with the stack operand Opcode behavior with the local variables array ClassFile ClassFile_Ref Figure 17: Bytecode executable class file generator the studied opcode and also monitor the possible energy consumption differences between all other KVM stages Results From all Java opcodes we will not study the 51 opcodes which handle floating point values as floating point is not supported by the CLDC specification. In addition opcodes including from 0x99 to 0xc9, see table 3 in annex section, can not be estimate using this comparison method as they either have a non constant behavior or have to be executed in a specific context from where the studied opcode energy cost can not be extracted from the context cost. For example it is not possible to disassociate by comparison the cost of the return opcode from the interface method invoking cost as invoking a method implie to execute at some point the opcode return only once. Also the cost of interpreting the opcode new will depend on severals parameters like the index position in the constant pool entry, the new object s image size, and if the entry has already been resolved or not by the virtual machine. Table 20 in the annex section shows for each studied opcode its energy consumption due to processor instructions execution and memories access as well as the number of processors cycles and processor instruction needed to execute it. On average one Java opcode consume 0.995NPO due to processor execution and 2.377NPO due to memory access with a standard deviation of respectively and 0.222NPO. We can also notice that loading value from the local variable array to the operand stack is lightly more expensive than storing the same value back to the local variable. It is also interesting to remark that the opcode bipush consume about 9% less energy than iload and 5% less than the ilaod_x opcodes. Thus it is more energy efficient to load an constant integer lower than 256 into the operand stack using bipush than initializing the local variable array with the constant and using iload or ilaod_x. The same is true if a constant integer lower than

21 ClassFile Method 1: 0000d access flags = da 0008 name = #8<main> 0000dc 0009 descriptor = #9<([Ljava/lang/String;)V> 0000de field/method attributes: field/method attribute e name = #6<Code> 0000e length = e max stack: e max locals: ea code length: ee 00 0 nop 0000ef 00 1 nop 0000f nop 0000f nop ed nop 0001ee b1 256 return 0001ef exception table entries: ClassFile_Ref Method 1: 0000d access flags = da 0008 name = #8<main> 0000dc 0009 descriptor = #9<([Ljava/lang/String;)V> 0000de field/method attributes: field/method attribute e name = #6<Code> 0000e length = e max stack: e max locals: ea code length: ee b1 0 return 0000ef exception table entries: Figure 18: Example of generated byte-code class files has to be load into the operand stack, it will be more efficient to use the opcode bipush instead of iload, but if the integer constant can be stored in the first 4 local variables then iload_x became the most efficient opcode. It is also important to compare the obtained values with the NOP energy consumption. As the opcode NOP is the first case statement in the interpreter s switch and doesn t execute any instruction, its energy consumption represent the minimum overhead cost due to the interpreter mechanism. For the most expensive studied opcode, dup2_x2, the interpreter mechanism overhead represent about 63% of its energy consumption. 5 Conclusion Several observations have been done in this report concerning the energy consumption of the KVM. For the hardware configuration fixed by the KVM enprofiler, the distribution between the processor and memories is constant over the KVM execution with 70% of the energy consumed through memory accesses. This shows the major importance of the memories concerning an embedded system s runtime performance. In addition our analysis shows that the virtual machine interpreter is far ahead the main source of energy consumption As the interpreter mechanism overhead cost is the predominant factor in opcode execution cost, it will be interesting to look at the cost differences between the two possible Java execution modes: interpreted or JIT compilation. 19

22 References [1] G. Cabillic T. Higuera V. Issarny J-P Lesot F. Parain, M. Banâtre. Techniques de réduction de la consommation dans les systèmes embarqués temps-réel. Technical report, INRIA Rennes, [2] Vivek Tiwari and Sharad Malik and Andrew Wolfe. Power Analysis of Embedded Software. In International Conference on Computer-Aided Design, San Jose CA., nov [3] A. Seth and R.B. Keskar and R. Venugopal. Algorithms for Energy Optimization Using Processor Instruction. In Cases 01, [4] R. Venugopal Anil Seth, Ravindra B Keskar. Algorithms for energy optimization using processor instructions. In International conference on Compilers, architecture, and synthesis for embedded systems- Atlanta, Georgia, USA, [5] Wen-Tsong Shiue. Retargetable Compilation for Low Power. Technical report, Silicon Metrics Corporation. [6] Sharad Malik Mike Tien-Chien Lee, Vivek Tiwari. Power analysis and lowpower scheduling. In International Symposium on System Synthesis, Cannes, France, sep [7] Vivek Tiwari Mike Tien-Chien Lee. A Memory Allocation Technique for Low-Energy Embedded DSP Software. In IEEE Symposium on Low Power Electronics, San Diego, CA, oct [8] Catherine H. Gebotys. Low Energy Memory and Register Allocation Using Network Flow. In Design Automation Conference, pages , jun [9] X. Fan, C. Ellis, and A. Lebeck. Memory controller policies for DRAM power management. International Symposium on Low Power Electronics and Design (ISLPED), aug [10] S. Wuytack. Global communication and memory optimizing transformations for low power systems. IEEE Intnl. Workshop on LPD, Napa, CA, [11] Siemens Press Office - Release N. ICP CD [12] Ronny Tits Luc Claesen, Hans de Kuyper. Low power applications at system level. In Low Power Design in Deep Submicron Electronics, pages ,

23 [13] Cabillic Gilbert Higuera Teresa Issarny Valérie Lesot Jean-Philippe Parain Frédéric, Banâtre Michel. Techniques de réduction de la consommation dans les systèmes embarqué temps-réel. Technical report, INRIA Rennes, [14] Ghavam G. Shahidi Bijan Davari, Robert H. Dennard. Cmos scaling for high performance and low power - the next ten years. In Proceeding of the IEEE, Vol. 83, No4, pages , [15] Ravi Ambatipudi Clive Watts. ARM Information Quarterly Magazine, volume 2, number 3, pages [16] Alan Demers Scott Shenker Mark Weiser, Brent Welch. Scheduling for reduced cpu energy. In First Symposium on Operating System Design and Implementation, November [17] Mani B. Srivastava Inki Hong, Miodrag Potkonjak. On-line scheduling of hard real-time tasks on variable voltage processor. In IEEE/ACM international conference on Computer-aided design, pages , [18] Gang Qu Miodrag Potkonjak Mani B. Srivastava Inki Hong, Darko Kirovski. Power optimization of variable voltage core-based systems. IEEE Transaction on computer-aided design of integrated circuits and systems, 18(12), [19] Tien-fu Chen Jian Liang Kuo. Dynamic voltage leveling scheduling for realtime embedded systems on low-power variable speed processors. CASSES 2002, Grenoble - France. [20] Andrew Wolfe Vivek Tiwari, Sharad Malik. Power analysis of embedded software: A first step towards software power minimization. In IEEE Transactions on VLSI Systems, December [21] Mike T.-C. Lee V. Tiwari. Power analysis of a 32 bit embedded microcontroller. In Prof. Asia and South Pacific Design Automation Conf., pages , [22] Andrew Wolfe Vivek Tiwari, Sharad Malik. Compilation techniques for low energy: An overview. In Symposium on Low Power Electronics, October [23] Sharad Malik Masahiro Fujita Mike Tien-Chien Lee, Vivek Tiwari. Power analysis and minimization techniques for embedded dsp software. In IEEE Transactions on VLSI Systems, Decembre

24 [24] Mark C. Johnson Kaushik Roy. Software design for low power. In Low Power Design in Deep Submicron Electronics, pages , [25] Enprofiler. [26] An introduction to thumb. Technical report, Advenced RISC Machines Ltd, [27] Lars Wehmeyer Peter Marwedel Stefan Steinke, Markus Knauer. An accurate fine grain instruction-level enrgy model supporting software optimization. In PATMOS 01,

25 A Annex Opcode Inst. Cost in J Mem. CostJ Nb Cycles Nb Proc. Inst. nop iconst_null 0x iconst_m1 0x iconst_0 0x iconst_1 0x iconst_2 0x iconst_3 0x iconst_4 0x iconst_5 0x lconst_0 0x lconst_1 0xa bipush 0x sipush 0x iload 0x lload 0x lload 0x aload 0x iload_0 0x1a iload_1 0x1b iload_2 0x1c iload_3 0x1d lload_0 0x1e lload_1 0x1f lload_2 0x lload_3 0x aload_0 0x2a aload_1 0x2b aload_2 0x2c aload_3 0x2d istore 0x lstore 0x Figure 19: Java opcodes costs - Part 1 23

26 Opcode Inst. Cost in J Mem. CostJ Nb Cycles Nb Proc. Inst. astore 0x3a istore_0 0x3b istore_1 0x3c istore_2 0x3d istore_3 0x3e lstore_0 0x3f lstore_1 0x lstore_2 0x lstore_3 0x astore_0 0x4b astore_1 0x4c astore_2 0x4d astore_3 0x4e pop 0x pop2 0x dup 0x dup_x1 0x5a dup_x2 0x5b dup2 0x5c dup2_x1 0x5d dup2_x2 0x5e swap 0x5f iadd 0x isub 0x imul 0x ineg 0x ishl 0x ishr 0x7a iushr 0x7c land 0x7f lor 0x Figure 20: Java opcodes costs - Part 2 24

27 0x99 ifeq 0x9a ifne 0x9b iflt 0x9c ifgt 0x9d ifle 0x9e if_icmpeg 0x9f if_icmpeg 0xa0 if_icmpne 0xa1 if_icmplt 0xa2 if_icmpge 0xa3 if_icmpgt 0xa4 if_icmple 0xa5 if_acmpeg 0xa6 if_acmpne 0xa7 goto 0xa8 jsr 0xa9 ret 0xaa tableswitch 0xab lookupswitch 0xac ireturn 0xad lreturn 0xae freturn 0xaf dreturn 0xb0 areturn 0xb1 return 0xb2 getstatic 0xb3 putstatic 0xb4 getfield 0xb5 putfield 0xb6 invokevirtual 0xb7 invokespecial 0xb8 invokestatic 0xb9 invokeinterface 0xbb new 0xbc newarray 0xbd anewarray 0xbe arraylenght 0xbf athrow 0xc0 checkcast 0xc1 instanceof 0xc2 monitorenter 0xc3 monitorexit 0xc4 wide 0xc5 multianewarray 0xc6 ifnull 0xc7 ifnonnull 0xc8 goto_w 0xc9 jsr_w Table 3: Opcodes from 0x99 to 0xc9 25

28 Turku Centre for Computer Science Lemminkäisenkatu 14 FIN Turku Finland University of Turku Q Department of Information Technology Q Department of Mathematics Åbo Akademi University Q Department of Computer Science Q Institute for Advanced Management Systems Research Turku School of Economics and Business Administration Q Institute of Information Systems Science

Chapter 7D The Java Virtual Machine

Chapter 7D The Java Virtual Machine This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly

More information

v11 v12 v8 v6 v10 v13

v11 v12 v8 v6 v10 v13 Analyzing Control Flow in Java Bytecode Jianjun Zhao Department of Computer Science and Engineering Fukuoka Institute of Technology 3-10-1 Wajiro-Higashi, Higashi-ku, Fukuoka 811-02, Japan zhao@cs.t.ac.jp

More information

The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. buford@alum.mit.edu Oct 2003 Presented to Gordon College CS 311

The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. buford@alum.mit.edu Oct 2003 Presented to Gordon College CS 311 The Java Virtual Machine and Mobile Devices John Buford, Ph.D. buford@alum.mit.edu Oct 2003 Presented to Gordon College CS 311 Objectives Review virtual machine concept Introduce stack machine architecture

More information

AVR 32-bit Microcontroller. Java Technical Reference. 1. Introduction. 1.1 Intended audience. 1.2 The AVR32 Java Extension Module

AVR 32-bit Microcontroller. Java Technical Reference. 1. Introduction. 1.1 Intended audience. 1.2 The AVR32 Java Extension Module 1. Introduction 1.1 Intended audience This manual is intended for developers implementing Java virtual machines or Java debuggers using the AVR 32 Java Extension Module, or others needing information on

More information

02 B The Java Virtual Machine

02 B The Java Virtual Machine 02 B The Java Virtual Machine CS1102S: Data Structures and Algorithms Martin Henz January 22, 2010 Generated on Friday 22 nd January, 2010, 09:46 CS1102S: Data Structures and Algorithms 02 B The Java Virtual

More information

picojava TM : A Hardware Implementation of the Java Virtual Machine

picojava TM : A Hardware Implementation of the Java Virtual Machine picojava TM : A Hardware Implementation of the Java Virtual Machine Marc Tremblay and Michael O Connor Sun Microelectronics Slide 1 The Java picojava Synergy Java s origins lie in improving the consumer

More information

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters Interpreters and virtual machines Michel Schinz 2007 03 23 Interpreters Interpreters Why interpreters? An interpreter is a program that executes another program, represented as some kind of data-structure.

More information

The Java Virtual Machine Specification. Java SE 8 Edition

The Java Virtual Machine Specification. Java SE 8 Edition The Java Virtual Machine Specification Java SE 8 Edition This page intentionally left blank The Java Virtual Machine Specification Java SE 8 Edition Tim Lindholm Frank Yellin Gilad Bracha Alex Buckley

More information

Java Programming. Binnur Kurt binnur.kurt@ieee.org. Istanbul Technical University Computer Engineering Department. Java Programming. Version 0.0.

Java Programming. Binnur Kurt binnur.kurt@ieee.org. Istanbul Technical University Computer Engineering Department. Java Programming. Version 0.0. Java Programming Binnur Kurt binnur.kurt@ieee.org Istanbul Technical University Computer Engineering Department Java Programming 1 Version 0.0.4 About the Lecturer BSc İTÜ, Computer Engineering Department,

More information

Armed E-Bunny: A Selective Dynamic Compiler for Embedded Java Virtual Machine Targeting ARM Processors

Armed E-Bunny: A Selective Dynamic Compiler for Embedded Java Virtual Machine Targeting ARM Processors 2005 ACM Symposium on Applied Computing Armed E-Bunny: A Selective Dynamic Compiler for Embedded Java Virtual Machine Targeting ARM Processors Mourad Debbabi Computer Security Research Group CIISE, Concordia

More information

University of Twente. A simulation of the Java Virtual Machine using graph grammars

University of Twente. A simulation of the Java Virtual Machine using graph grammars University of Twente Department of Computer Science A simulation of the Java Virtual Machine using graph grammars Master of Science thesis M. R. Arends, November 2003 A simulation of the Java Virtual Machine

More information

CSC 8505 Handout : JVM & Jasmin

CSC 8505 Handout : JVM & Jasmin CSC 8505 Handout : JVM & Jasmin Note: This handout provides you with the basic information about JVM. Although we tried to be accurate about the description, there may be errors. Feel free to check your

More information

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program CS 2112 Lecture 27 Interpreters, compilers, and the Java Virtual Machine 1 May 2012 Lecturer: Andrew Myers 1 Interpreters vs. compilers There are two strategies for obtaining runnable code from a program

More information

HOTPATH VM. An Effective JIT Compiler for Resource-constrained Devices

HOTPATH VM. An Effective JIT Compiler for Resource-constrained Devices HOTPATH VM An Effective JIT Compiler for Resource-constrained Devices based on the paper by Andreas Gal, Christian W. Probst and Michael Franz, VEE 06 INTRODUCTION INTRODUCTION Most important factor: speed

More information

Habanero Extreme Scale Software Research Project

Habanero Extreme Scale Software Research Project Habanero Extreme Scale Software Research Project Comp215: Java Method Dispatch Zoran Budimlić (Rice University) Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead

More information

The Java Virtual Machine (JVM) Pat Morin COMP 3002

The Java Virtual Machine (JVM) Pat Morin COMP 3002 The Java Virtual Machine (JVM) Pat Morin COMP 3002 Outline Topic 1 Topic 2 Subtopic 2.1 Subtopic 2.2 Topic 3 2 What is the JVM? The JVM is a specification of a computing machine Instruction set Primitive

More information

Virtual Machines. Case Study: JVM. Virtual Machine, Intermediate Language. JVM Case Study. JVM: Java Byte-Code. JVM: Type System

Virtual Machines. Case Study: JVM. Virtual Machine, Intermediate Language. JVM Case Study. JVM: Java Byte-Code. JVM: Type System Case Study: JVM Virtual Machines What is a machine? does something (...useful) programmable concrete (hardware) What is a virtual machine? a machine that is not concrete a software emulation of a physical

More information

Java Card 3 Platform. Virtual Machine Specification, Classic Edition. Version 3.0.5. May 2015

Java Card 3 Platform. Virtual Machine Specification, Classic Edition. Version 3.0.5. May 2015 Java Card 3 Platform Virtual Machine Specification, Classic Edition Version 3.0.5 May 2015 Java Card 3 Platform Virtual Machine Specification, Classic Edition Version 3.0.5 Copyright 1998, 2015, Oracle

More information

Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine

Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine This is a limited version of a hardware implementation to execute the JAVA programming language. 1 of 23 Structured Computer

More information

Built-in Concurrency Primitives in Java Programming Language. by Yourii Martiak and Mahir Atmis

Built-in Concurrency Primitives in Java Programming Language. by Yourii Martiak and Mahir Atmis Built-in Concurrency Primitives in Java Programming Language by Yourii Martiak and Mahir Atmis Overview One of the many strengths of Java is the built into the programming language support for concurrency

More information

1 The Java Virtual Machine

1 The Java Virtual Machine 1 The Java Virtual Machine About the Spec Format This document describes the Java virtual machine and the instruction set. In this introduction, each component of the machine is briefly described. This

More information

General Introduction

General Introduction Managed Runtime Technology: General Introduction Xiao-Feng Li (xiaofeng.li@gmail.com) 2012-10-10 Agenda Virtual machines Managed runtime systems EE and MM (JIT and GC) Summary 10/10/2012 Managed Runtime

More information

Java Virtual Machine Locks

Java Virtual Machine Locks Java Virtual Machine Locks SS 2008 Synchronized Gerald SCHARITZER (e0127228) 2008-05-27 Synchronized 1 / 13 Table of Contents 1 Scope...3 1.1 Constraints...3 1.2 In Scope...3 1.3 Out of Scope...3 2 Logical

More information

The Java Virtual Machine Specification

The Java Virtual Machine Specification The Java Virtual Machine Specification Java SE 8 Edition Tim Lindholm Frank Yellin Gilad Bracha Alex Buckley 2015-02-13 Specification: JSR-337 Java SE 8 Release Contents ("Specification") Version: 8 Status:

More information

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert Ubiquitous Computing Ubiquitous Computing The Sensor Network System Sun SPOT: The Sun Small Programmable Object Technology Technology-Based Wireless Sensor Networks a Java Platform for Developing Applications

More information

Automist - A Tool for Automated Instruction Set Characterization of Embedded Processors

Automist - A Tool for Automated Instruction Set Characterization of Embedded Processors Automist - A Tool for Automated Instruction Set Characterization of Embedded Processors Manuel Wendt 1, Matthias Grumer 1, Christian Steger 1, Reinhold Weiß 1, Ulrich Neffe 2 and Andreas Mühlberger 2 1

More information

A Java Virtual Machine Architecture for Very Small Devices

A Java Virtual Machine Architecture for Very Small Devices A Java Virtual Machine Architecture for Very Small Devices Nik Shaylor Sun Microsystems Research Laboratories 2600 Casey Avenue Mountain View, CA 94043 USA nik.shaylor@sun.com Douglas N. Simon Sun Microsystems

More information

Java Virtual Machine, JVM

Java Virtual Machine, JVM Java Virtual Machine, JVM a Teodor Rus rus@cs.uiowa.edu The University of Iowa, Department of Computer Science a These slides have been developed by Teodor Rus. They are copyrighted materials and may not

More information

Programming the Android Platform. Logistics

Programming the Android Platform. Logistics Programming the Android Platform CMSC498G Logistics Professor Adam Porter 4125 AVW aporter@cs.umd.edu Course meets W 3:00 3:50 in CSI 3118 1 Goals Learn more about Mobile devices Mobile device programming

More information

The Hotspot Java Virtual Machine: Memory and Architecture

The Hotspot Java Virtual Machine: Memory and Architecture International Journal of Allied Practice, Research and Review Website: www.ijaprr.com (ISSN 2350-1294) The Hotspot Java Virtual Machine: Memory and Architecture Prof. Tejinder Singh Assistant Professor,

More information

HVM TP : A Time Predictable and Portable Java Virtual Machine for Hard Real-Time Embedded Systems JTRES 2014

HVM TP : A Time Predictable and Portable Java Virtual Machine for Hard Real-Time Embedded Systems JTRES 2014 : A Time Predictable and Portable Java Virtual Machine for Hard Real-Time Embedded Systems JTRES 2014 Kasper Søe Luckow 1 Bent Thomsen 1 Stephan Erbs Korsholm 2 1 Department of Computer Science Aalborg

More information

JPURE - A PURIFIED JAVA EXECUTION ENVIRONMENT FOR CONTROLLER NETWORKS 1

JPURE - A PURIFIED JAVA EXECUTION ENVIRONMENT FOR CONTROLLER NETWORKS 1 JPURE - A PURIFIED JAVA EXECUTION ENVIRONMENT FOR CONTROLLER NETWORKS 1 Danilo Beuche, Lars Büttner, Daniel Mahrenholz, Wolfgang Schröder-Preikschat, Friedrich Schön* University of Magdeburg * GMD-FIRST

More information

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM 1 The ARM architecture processors popular in Mobile phone systems 2 ARM Features ARM has 32-bit architecture but supports 16 bit

More information

Replication on Virtual Machines

Replication on Virtual Machines Replication on Virtual Machines Siggi Cherem CS 717 November 23rd, 2004 Outline 1 Introduction The Java Virtual Machine 2 Napper, Alvisi, Vin - DSN 2003 Introduction JVM as state machine Addressing non-determinism

More information

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives Introduction to Programming and Algorithms Module 1 CS 146 Sam Houston State University Dr. Tim McGuire Module Objectives To understand: the necessity of programming, differences between hardware and software,

More information

Reconfigurable Architecture Requirements for Co-Designed Virtual Machines

Reconfigurable Architecture Requirements for Co-Designed Virtual Machines Reconfigurable Architecture Requirements for Co-Designed Virtual Machines Kenneth B. Kent University of New Brunswick Faculty of Computer Science Fredericton, New Brunswick, Canada ken@unb.ca Micaela Serra

More information

Real-time Java Processor for Monitoring and Test

Real-time Java Processor for Monitoring and Test Real-time Java Processor for Monitoring and Test Martin Zabel, Thomas B. Preußer, Rainer G. Spallek Technische Universität Dresden {zabel,preusser,rgs}@ite.inf.tu-dresden.de Abstract This paper introduces

More information

LaTTe: An Open-Source Java VM Just-in Compiler

LaTTe: An Open-Source Java VM Just-in Compiler LaTTe: An Open-Source Java VM Just-in in-time Compiler S.-M. Moon, B.-S. Yang, S. Park, J. Lee, S. Lee, J. Park, Y. C. Chung, S. Kim Seoul National University Kemal Ebcioglu, Erik Altman IBM T.J. Watson

More information

Instruction Set Design

Instruction Set Design Instruction Set Design Instruction Set Architecture: to what purpose? ISA provides the level of abstraction between the software and the hardware One of the most important abstraction in CS It s narrow,

More information

PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions. Outline. Performance oriented design

PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions. Outline. Performance oriented design PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions Slide 1 Outline Principles for performance oriented design Performance testing Performance tuning General

More information

Characterizing Java Virtual Machine for More Efficient Processor Power Management. Abstract

Characterizing Java Virtual Machine for More Efficient Processor Power Management. Abstract Characterizing Java Virtual Machine for More Efficient Processor Power Management Marcelo S. Quijano, Lide Duan Department of Electrical and Computer Engineering University of Texas at San Antonio hrk594@my.utsa.edu,

More information

Monitors and Exceptions : How to Implement Java efficiently. Andreas Krall and Mark Probst Technische Universitaet Wien

Monitors and Exceptions : How to Implement Java efficiently. Andreas Krall and Mark Probst Technische Universitaet Wien Monitors and Exceptions : How to Implement Java efficiently Andreas Krall and Mark Probst Technische Universitaet Wien 1 Outline Exceptions in CACAO Exception implementation techniques CACAO s implementation

More information

Memory Systems. Static Random Access Memory (SRAM) Cell

Memory Systems. Static Random Access Memory (SRAM) Cell Memory Systems This chapter begins the discussion of memory systems from the implementation of a single bit. The architecture of memory chips is then constructed using arrays of bit implementations coupled

More information

A Survey on ARM Cortex A Processors. Wei Wang Tanima Dey

A Survey on ARM Cortex A Processors. Wei Wang Tanima Dey A Survey on ARM Cortex A Processors Wei Wang Tanima Dey 1 Overview of ARM Processors Focusing on Cortex A9 & Cortex A15 ARM ships no processors but only IP cores For SoC integration Targeting markets:

More information

Central Processing Unit (CPU)

Central Processing Unit (CPU) Central Processing Unit (CPU) CPU is the heart and brain It interprets and executes machine level instructions Controls data transfer from/to Main Memory (MM) and CPU Detects any errors In the following

More information

C Compiler Targeting the Java Virtual Machine

C Compiler Targeting the Java Virtual Machine C Compiler Targeting the Java Virtual Machine Jack Pien Senior Honors Thesis (Advisor: Javed A. Aslam) Dartmouth College Computer Science Technical Report PCS-TR98-334 May 30, 1998 Abstract One of the

More information

Hardware/Software Co-Design of a Java Virtual Machine

Hardware/Software Co-Design of a Java Virtual Machine Hardware/Software Co-Design of a Java Virtual Machine Kenneth B. Kent University of Victoria Dept. of Computer Science Victoria, British Columbia, Canada ken@csc.uvic.ca Micaela Serra University of Victoria

More information

Garbage Collection in the Java HotSpot Virtual Machine

Garbage Collection in the Java HotSpot Virtual Machine http://www.devx.com Printed from http://www.devx.com/java/article/21977/1954 Garbage Collection in the Java HotSpot Virtual Machine Gain a better understanding of how garbage collection in the Java HotSpot

More information

İSTANBUL AYDIN UNIVERSITY

İSTANBUL AYDIN UNIVERSITY İSTANBUL AYDIN UNIVERSITY FACULTY OF ENGİNEERİNG SOFTWARE ENGINEERING THE PROJECT OF THE INSTRUCTION SET COMPUTER ORGANIZATION GÖZDE ARAS B1205.090015 Instructor: Prof. Dr. HASAN HÜSEYİN BALIK DECEMBER

More information

EVALUATING POWER MANAGEMENT CAPABILITIES OF LOW-POWER CLOUD PLATFORMS. Jens Smeds

EVALUATING POWER MANAGEMENT CAPABILITIES OF LOW-POWER CLOUD PLATFORMS. Jens Smeds EVALUATING POWER MANAGEMENT CAPABILITIES OF LOW-POWER CLOUD PLATFORMS Jens Smeds Master of Science Thesis Supervisor: Prof. Johan Lilius Advisor: Dr. Sébastien Lafond Embedded Systems Laboratory Department

More information

Architectures and Platforms

Architectures and Platforms Hardware/Software Codesign Arch&Platf. - 1 Architectures and Platforms 1. Architecture Selection: The Basic Trade-Offs 2. General Purpose vs. Application-Specific Processors 3. Processor Specialisation

More information

Tutorial: Getting Started

Tutorial: Getting Started 9 Tutorial: Getting Started INFRASTRUCTURE A MAKEFILE PLAIN HELLO WORLD APERIODIC HELLO WORLD PERIODIC HELLO WORLD WATCH THOSE REAL-TIME PRIORITIES THEY ARE SERIOUS SUMMARY Getting started with a new platform

More information

From Control Loops to Software

From Control Loops to Software CNRS-VERIMAG Grenoble, France October 2006 Executive Summary Embedded systems realization of control systems by computers Computers are the major medium for realizing controllers There is a gap between

More information

Under the Hood: The Java Virtual Machine. Lecture 24 CS 2110 Fall 2011

Under the Hood: The Java Virtual Machine. Lecture 24 CS 2110 Fall 2011 Under the Hood: The Java Virtual Machine Lecture 24 CS 2110 Fall 2011 Compiling for Different Platforms Program written in some high-level language (C, Fortran, ML,...) Compiled to intermediate form Optimized

More information

- Applet java appaiono di frequente nelle pagine web - Come funziona l'interprete contenuto in ogni browser di un certo livello? - Per approfondire

- Applet java appaiono di frequente nelle pagine web - Come funziona l'interprete contenuto in ogni browser di un certo livello? - Per approfondire - Applet java appaiono di frequente nelle pagine web - Come funziona l'interprete contenuto in ogni browser di un certo livello? - Per approfondire il funzionamento della Java Virtual Machine (JVM): -

More information

Enery Efficient Dynamic Memory Bank and NV Swap Device Management

Enery Efficient Dynamic Memory Bank and NV Swap Device Management Enery Efficient Dynamic Memory Bank and NV Swap Device Management Kwangyoon Lee and Bumyong Choi Department of Computer Science and Engineering University of California, San Diego {kwl002,buchoi}@cs.ucsd.edu

More information

Application Note 195. ARM11 performance monitor unit. Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007

Application Note 195. ARM11 performance monitor unit. Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007 Application Note 195 ARM11 performance monitor unit Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007 Copyright 2007 ARM Limited. All rights reserved. Application Note

More information

Java Coding Practices for Improved Application Performance

Java Coding Practices for Improved Application Performance 1 Java Coding Practices for Improved Application Performance Lloyd Hagemo Senior Director Application Infrastructure Management Group Candle Corporation In the beginning, Java became the language of the

More information

Keil C51 Cross Compiler

Keil C51 Cross Compiler Keil C51 Cross Compiler ANSI C Compiler Generates fast compact code for the 8051 and it s derivatives Advantages of C over Assembler Do not need to know the microcontroller instruction set Register allocation

More information

Techniques for Real-System Characterization of Java Virtual Machine Energy and Power Behavior

Techniques for Real-System Characterization of Java Virtual Machine Energy and Power Behavior Techniques for Real-System Characterization of Java Virtual Machine Energy and Power Behavior Gilberto Contreras Margaret Martonosi Department of Electrical Engineering Princeton University 1 Why Study

More information

Retargeting Android Applications to Java Bytecode

Retargeting Android Applications to Java Bytecode Retargeting Android Applications to Java Bytecode Damien Octeau Department of Computer Science and Engineering Pennsylvania State University octeau@cse.psu.edu Somesh Jha Computer Sciences Department University

More information

Platform Independent Dynamic Java Virtual Machine Analysis: the Java Grande Forum Benchmark Suite

Platform Independent Dynamic Java Virtual Machine Analysis: the Java Grande Forum Benchmark Suite Platform Independent Dynamic Java Virtual Machine Analysis: the Java Grande Forum Benchmark Suite Charles Daly Computer Applications, Dublin City University, Dublin 9, Ireland. Jane Horgan Computer Applications,

More information

EXTENDING JAVA VIRTUAL MACHINE TO IMPROVE PERFORMANCE OF DYNAMICALLY-TYPED LANGUAGES. Yutaka Oiwa. A Senior Thesis

EXTENDING JAVA VIRTUAL MACHINE TO IMPROVE PERFORMANCE OF DYNAMICALLY-TYPED LANGUAGES. Yutaka Oiwa. A Senior Thesis EXTENDING JAVA VIRTUAL MACHINE TO IMPROVE PERFORMANCE OF DYNAMICALLY-TYPED LANGUAGES Java by Yutaka Oiwa A Senior Thesis Submitted to the Department of Information Science the Faculty of Science the University

More information

DESIGN CHALLENGES OF TECHNOLOGY SCALING

DESIGN CHALLENGES OF TECHNOLOGY SCALING DESIGN CHALLENGES OF TECHNOLOGY SCALING IS PROCESS TECHNOLOGY MEETING THE GOALS PREDICTED BY SCALING THEORY? AN ANALYSIS OF MICROPROCESSOR PERFORMANCE, TRANSISTOR DENSITY, AND POWER TRENDS THROUGH SUCCESSIVE

More information

Self-Evaluation Configuration for Remote Data Logging Systems

Self-Evaluation Configuration for Remote Data Logging Systems IEEE International Workshop on Intelligent Data Acquisition and Advanced Computing Systems: Technology and Applications 6-8 September 2007, Dortmund, Germany Self-Evaluation Configuration for Remote Data

More information

An Overview of Stack Architecture and the PSC 1000 Microprocessor

An Overview of Stack Architecture and the PSC 1000 Microprocessor An Overview of Stack Architecture and the PSC 1000 Microprocessor Introduction A stack is an important data handling structure used in computing. Specifically, a stack is a dynamic set of elements in which

More information

Instruction Set Architecture (ISA) Design. Classification Categories

Instruction Set Architecture (ISA) Design. Classification Categories Instruction Set Architecture (ISA) Design Overview» Classify Instruction set architectures» Look at how applications use ISAs» Examine a modern RISC ISA (DLX)» Measurement of ISA usage in real computers

More information

The Design of the Inferno Virtual Machine. Introduction

The Design of the Inferno Virtual Machine. Introduction The Design of the Inferno Virtual Machine Phil Winterbottom Rob Pike Bell Labs, Lucent Technologies {philw, rob}@plan9.bell-labs.com http://www.lucent.com/inferno Introduction Virtual Machine are topical

More information

Virtualization. Clothing the Wolf in Wool. Wednesday, April 17, 13

Virtualization. Clothing the Wolf in Wool. Wednesday, April 17, 13 Virtualization Clothing the Wolf in Wool Virtual Machines Began in 1960s with IBM and MIT Project MAC Also called open shop operating systems Present user with the view of a bare machine Execute most instructions

More information

A JAVA VIRTUAL MACHINE FOR THE ARM PROCESSOR

A JAVA VIRTUAL MACHINE FOR THE ARM PROCESSOR A JAVA VIRTUAL MACHINE FOR THE ARM PROCESSOR A report submitted to the University of Manchester for the purpose of a Master of Science in the Faculty of Science and Engineering September 2004 By Ming Chen

More information

An evaluation of the Java Card environment

An evaluation of the Java Card environment An evaluation of the Java Card environment Christophe Rippert, Daniel Hagimont Contact: Christophe Rippert, Sirac Laboratory INRIA Rhône-Alpes, 655 avenue de l Europe Montbonnot 38334 St Ismier Cedex,

More information

Introduction to Java

Introduction to Java Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high

More information

Java Virtual-Machine Support for Portable Worst-Case Execution-Time Analysis

Java Virtual-Machine Support for Portable Worst-Case Execution-Time Analysis Java Virtual-Machine Support for Portable Worst-Case Execution-Time Analysis I. Bate, G. Bernat Department of Computer Science University of York York, YO10 5DD, UK iain.bate, bernat @cs.york.ac.uk P.

More information

International Journal of Electronics and Computer Science Engineering 1482

International Journal of Electronics and Computer Science Engineering 1482 International Journal of Electronics and Computer Science Engineering 1482 Available Online at www.ijecse.org ISSN- 2277-1956 Behavioral Analysis of Different ALU Architectures G.V.V.S.R.Krishna Assistant

More information

Virtual Machine Showdown: Stack Versus Registers

Virtual Machine Showdown: Stack Versus Registers Virtual Machine Showdown: Stack Versus Registers Yunhe Shi, David Gregg, Andrew Beatty Department of Computer Science University of Dublin, Trinity College Dublin 2, Ireland {yshi, David.Gregg, Andrew.Beatty}@cs.tcd.ie

More information

Configurable Events for APC Network Management Card

Configurable Events for APC Network Management Card Configurable s for APC Network Management Card Table of Contents Silcon DP300E Series 3 Smart-UPS / Matrix 7 Symmetra 9 Symmetra 3-Phase 13 Environmental Monitor 21 Configurable s for APC Network Management

More information

Java Card. Smartcards. Demos. . p.1/30

Java Card. Smartcards. Demos. . p.1/30 . p.1/30 Java Card Smartcards Java Card Demos Smart Cards. p.2/30 . p.3/30 Smartcards Credit-card size piece of plastic with embedded chip, for storing & processing data Standard applications bank cards

More information

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 3, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts

More information

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA Features Compatible with MCS-51 products On-chip Flash Program Memory Endurance: 1,000 Write/Erase Cycles On-chip EEPROM Data Memory Endurance: 100,000 Write/Erase Cycles 512 x 8-bit RAM ISO 7816 I/O Port

More information

7a. System-on-chip design and prototyping platforms

7a. System-on-chip design and prototyping platforms 7a. System-on-chip design and prototyping platforms Labros Bisdounis, Ph.D. Department of Computer and Communication Engineering 1 What is System-on-Chip (SoC)? System-on-chip is an integrated circuit

More information

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA) Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine

More information

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? Inside the CPU how does the CPU work? what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? some short, boring programs to illustrate the

More information

Introduction to VLSI Programming. TU/e course 2IN30. Prof.dr.ir. Kees van Berkel Dr. Johan Lukkien [Dr.ir. Ad Peeters, Philips Nat.

Introduction to VLSI Programming. TU/e course 2IN30. Prof.dr.ir. Kees van Berkel Dr. Johan Lukkien [Dr.ir. Ad Peeters, Philips Nat. Introduction to VLSI Programming TU/e course 2IN30 Prof.dr.ir. Kees van Berkel Dr. Johan Lukkien [Dr.ir. Ad Peeters, Philips Nat.Lab] Introduction to VLSI Programming Goals Create silicon (CMOS) awareness

More information

Atmel AVR4027: Tips and Tricks to Optimize Your C Code for 8-bit AVR Microcontrollers. 8-bit Atmel Microcontrollers. Application Note.

Atmel AVR4027: Tips and Tricks to Optimize Your C Code for 8-bit AVR Microcontrollers. 8-bit Atmel Microcontrollers. Application Note. Atmel AVR4027: Tips and Tricks to Optimize Your C Code for 8-bit AVR Microcontrollers Features Atmel AVR core and Atmel AVR GCC introduction Tips and tricks to reduce code size Tips and tricks to reduce

More information

The Heartbeat behind Portable Medical Devices: Ultra-Low-Power Mixed-Signal Microcontrollers

The Heartbeat behind Portable Medical Devices: Ultra-Low-Power Mixed-Signal Microcontrollers The Heartbeat behind Portable Medical Devices: Ultra-Low-Power Mixed-Signal Microcontrollers The proliferation of sophisticated yet affordable personal medical devices is transforming the health care industry,

More information

Mobile Processors: Future Trends

Mobile Processors: Future Trends Mobile Processors: Future Trends Mário André Pinto Ferreira de Araújo Departamento de Informática, Universidade do Minho 4710-057 Braga, Portugal maaraujo@mail.pt Abstract. Mobile devices, such as handhelds,

More information

Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual

More information

Jonathan Worthington Scarborough Linux User Group

Jonathan Worthington Scarborough Linux User Group Jonathan Worthington Scarborough Linux User Group Introduction What does a Virtual Machine do? Hides away the details of the hardware platform and operating system. Defines a common set of instructions.

More information

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming Java has become enormously popular. Java s rapid rise and wide acceptance can be traced to its design

More information

VLIW Processors. VLIW Processors

VLIW Processors. VLIW Processors 1 VLIW Processors VLIW ( very long instruction word ) processors instructions are scheduled by the compiler a fixed number of operations are formatted as one big instruction (called a bundle) usually LIW

More information

Computer Organization and Architecture

Computer Organization and Architecture Computer Organization and Architecture Chapter 11 Instruction Sets: Addressing Modes and Formats Instruction Set Design One goal of instruction set design is to minimize instruction length Another goal

More information

Prototyping Faithful Execution in a Java Virtual Machine

Prototyping Faithful Execution in a Java Virtual Machine SANDIA REPORT SAND2003-2327 Unlimited Release Printed July 2003 Prototyping Faithful Execution in a Java Virtual Machine Philip L. Campbell, Lyndon G. Pierson, Thomas D. Tarman Prepared by Sandia National

More information

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing How is it possible for each process to have contiguous addresses and so many of them? Computer Systems Organization (Spring ) CSCI-UA, Section Instructor: Joanna Klukowska Teaching Assistants: Paige Connelly

More information

Checking Access to Protected Members in the Java Virtual Machine

Checking Access to Protected Members in the Java Virtual Machine Checking Access to Protected Members in the Java Virtual Machine Alessandro Coglio Kestrel Institute 3260 Hillview Avenue, Palo Alto, CA 94304, USA Ph. +1-650-493-6871 Fax +1-650-424-1807 http://www.kestrel.edu/

More information

11.1 inspectit. 11.1. inspectit

11.1 inspectit. 11.1. inspectit 11.1. inspectit Figure 11.1. Overview on the inspectit components [Siegl and Bouillet 2011] 11.1 inspectit The inspectit monitoring tool (website: http://www.inspectit.eu/) has been developed by NovaTec.

More information

18-447 Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013

18-447 Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013 18-447 Computer Architecture Lecture 3: ISA Tradeoffs Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013 Reminder: Homeworks for Next Two Weeks Homework 0 Due next Wednesday (Jan 23), right

More information

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University Multitasking ARM-Applications with uvision and RTX 1. Objectives The purpose of this lab is to lab is to introduce

More information

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2 Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of

More information

ARM Microprocessor and ARM-Based Microcontrollers

ARM Microprocessor and ARM-Based Microcontrollers ARM Microprocessor and ARM-Based Microcontrollers Nguatem William 24th May 2006 A Microcontroller-Based Embedded System Roadmap 1 Introduction ARM ARM Basics 2 ARM Extensions Thumb Jazelle NEON & DSP Enhancement

More information

(Refer Slide Time: 02:39)

(Refer Slide Time: 02:39) Computer Architecture Prof. Anshul Kumar Department of Computer Science and Engineering, Indian Institute of Technology, Delhi Lecture - 1 Introduction Welcome to this course on computer architecture.

More information