Runtime Analysis of Hotspot Java Virtual Machine

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

Java Applet Security Diana Dong CS 265 Spring 2004.
Java Basic Training HaiNH - FQA. Agenda Introduction to Java Java Programming Environment Language Fundamental Object Oriented Programming with Java.
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
JETT 2003 Java.compareTo(C++). JAVA Java Platform consists of 4 parts: –Java Language –Java API –Java class format –Java Virtual Machine.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
CS884 (Prasad)Java Goals1 “Perfect Quote” You know you've achieved perfection in design, Not when you have nothing more to add, But when you have nothing.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Embedded Java Research Geoffrey Beers Peter Jantz December 18, 2001.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Dynamic Compilation II John Cavazos University.
Real-Time Software Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
JAVA Introduction ● One of the main JAVA design goal is reducing complexity for programmer – Development time is half or less comparing to equivalent C++
Lecture 10 : Introduction to Java Virtual Machine
Introduction to the Java Virtual Machine 井民全. JVM (Java Virtual Machine) the environment in which the java programs execute The specification define an.
EMSOFT’02 Silicomp Research Institute JCOD 1 JCOD A Lightweight Modular Compilation Technology For Embedded Java Bertrand Delsart :
Multithreading in Java Project of COCS 513 By Wei Li December, 2000.
Java Virtual Machine Case Study on the Design of JikesRVM.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
CPRG 215 Introduction to Object-Oriented Programming with Java Module 1-Introduction to Java Topic 1.1 Basics of Java Produced by Harvey Peters, 2008 Copyright.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
Instrumentation in Software Dynamic Translators for Self-Managed Systems Bruce R. Childers Naveen Kumar, Jonathan Misurda and Mary.
Performance Comparison Xen vs. KVM vs. Native –Benchmarks: SPEC CPU2006, SPEC JBB 2005, SPEC WEB, TPC –Case studies Design instrumentations for figure.
Virtual Machines, Interpretation Techniques, and Just-In-Time Compilers Kostis Sagonas
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
Yang Yu, Tianyang Lei, Haibo Chen, Binyu Zang Fudan University, China Shanghai Jiao Tong University, China Institute of Parallel and Distributed Systems.
CSC Multiprocessor Programming, Spring, 2012 Chapter 11 – Performance and Scalability Dr. Dale E. Parson, week 12.
CSE 598c – Virtual Machines Survey Proposal: Improving Performance for the JVM Sandra Rueda.
JAVA Ekapap Julnonyang When it was implemented? Developed by Sun Microsystems. The first public implementation was Java 1.0 in 1995 The language.
Introduction to Garbage Collection. Garbage Collection It automatically reclaims memory occupied by objects that are no longer in use It frees the programmer.
Vertical Profiling : Understanding the Behavior of Object-Oriented Applications Sookmyung Women’s Univ. PsLab Sewon,Moon.
Introduction to Programming 1 1 2Introduction to Java.
RealTimeSystems Lab Jong-Koo, Lim
JAVA TRAINING IN NOIDA. JAVA Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically.
JAVA TRAINING IN NOIDA. Introduction to Java:  Java training in noida is a general-purpose computer programming language that is concurrent, class-based,
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
(Not too) Real-Time JVM (Progress Report)
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Core Java Garbage Collection LEVEL – PRACTITIONER.
Topic: Java Garbage Collection
Before You Begin Nahla Abuel-ola /WIT.
Interpreted languages Jakub Yaghob
Credits: 3 CIE: 50 Marks SEE:100 Marks Lab: Embedded and IOT Lab
Unit-2 Objects and Classes
Operating Systems: A Modern Perspective, Chapter 6
JAVA Introduction ការណែនាំពី Java
Progress Report Meeting
Lecture 1 Runtime environments.
Introduction Enosis Learning.
CMPE419 Mobile Application Development
2.1. Compilers and Interpreters
Real-time Software Design
Introduction Enosis Learning.
“just-in-time” compilation (JIT) technique prepared by - Harshada Hole
Adaptive Code Unloading for Resource-Constrained JVMs
(Computer fundamental Lab)
Lecture 1 Runtime environments.
CMPE419 Mobile Application Development
M S COLLEGE ART’S, COMM., SCI. & BMS
CSc 453 Interpreters & Interpretation
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
CSC Multiprocessor Programming, Spring, 2011
Presentation transcript:

Runtime Analysis of Hotspot Java Virtual Machine Progress Report Meeting December 7, 2017 Houssem Daoud Michel Dagenais École Polytechnique de Montréal Laboratoire DORSAL

Agenda Introduction Thread Management JIT compilation Object Allocation Garbage Collection Java Flame Chart Conclusion POLYTECHNIQUE MONTREAL – Houssem Daoud

Introduction Features of Java: Object Oriented Platform independent Dynamic Interpreted/Compiled Hotspot is an open source virtual machine by Oracle POLYTECHNIQUE MONTREAL – Houssem Daoud

Introduction Runtime Environment Source .java Class Loader Compiler Java Interpreter JIT Compiler Bytecode .class Execution Engine Operating System Hardware POLYTECHNIQUE MONTREAL – Houssem Daoud

Introduction Hotspot VM provides: Class loader Java bytecode interpreter JIT compiler Automatic memory management mechanisms Several garbage collectors The behavior of programs is sometimes unpredictable. Runtime analysis is required POLYTECHNIQUE MONTREAL – Houssem Daoud

Introduction Most available tools use userspace tracing or JMX technology to collect runtime information. Some important events are not visible from the userspace POLYTECHNIQUE MONTREAL – Houssem Daoud

Introduction Kernel tracing provides more information about the system: System calls, disk access, network access, interrupts, etc. But.. POLYTECHNIQUE MONTREAL – Houssem Daoud

Our goal is Introduction To provide a JVM analysis tool that bridges the gap between userspace and kernel space traces POLYTECHNIQUE MONTREAL – Houssem Daoud

Agenda Introduction Thread Management JIT compilation Object Allocation Garbage Collection Java Flame Chart Conclusion POLYTECHNIQUE MONTREAL – Houssem Daoud

Thread Management Hotspot VM uses a 1:1 threading model Each Java thread (JavaThread) is mapped to a native operating system thread (OSThread) The main types of threads are: Compiler threads, GC threads, VM ops threads, etc.. JIT Compiler Garbage collector JIT 1 JIT 2 GC 1 GC 2 Main thread GC 4 GC 3 Reference handler Finalizer Signal Dispatcher POLYTECHNIQUE MONTREAL – Houssem Daoud A simple java program can generate a dozen or more threads in the system

Thread Management (name, java_threadid, os_threadid, deamon) thread_start thread_stop thread_sleep_start thread_sleep_end (name, java_threadid, os_threadid, deamon) We use this information to associate Java thread to Kernel threads POLYTECHNIQUE MONTREAL – Houssem Daoud

Thread Management Unified Kernel/User-space view for Java threads POLYTECHNIQUE MONTREAL – Houssem Daoud

Thread Management We can see low-level details syscall_entry_futex Java threads can be considered RUNNING from the user-space point of view, but in reality they are interrupted by the operating system. POLYTECHNIQUE MONTREAL – Houssem Daoud

Agenda Introduction Thread Management JIT compilation Object Allocation Garbage Collection Java Flame Chart Conclusion POLYTECHNIQUE MONTREAL – Houssem Daoud

JIT Compilation Hotspot VM is equipped with an advanced just-in-time (JIT) compiler C1 provides fast compilation. C2 is more aggressive and generates more optimized code Tiered compilation: Methods are first compiled by C1; as they become hot, they are recompiled by C2. POLYTECHNIQUE MONTREAL – Houssem Daoud

JIT Compilation We added the following tracepoints: method_compile_begin, method_compile_end and method_load POLYTECHNIQUE MONTREAL – Houssem Daoud

JIT Compilation The view shows that there is one C1 thread and three C2 threads. We can see the methods that are currently being compiled. POLYTECHNIQUE MONTREAL – Houssem Daoud

Agenda Introduction Thread Management JIT Compilation Object Allocation Garbage Collection Java Flame Chart Conclusion POLYTECHNIQUE MONTREAL – Houssem Daoud

Object Allocation Each Java thread has its own TLAB (Thread Local Allocation Buffer). Allocating an object inside TLAB doesn't require synchronization mechanisms. Java objects are preferably allocated inside TLABs. Large objects are allocated outside We instrumented the memory management subsystem to track object allocation: alloc_new_tlab and alloc_outside_tlab POLYTECHNIQUE MONTREAL – Houssem Daoud

Object Allocation POLYTECHNIQUE MONTREAL – Houssem Daoud

Agenda Introduction Thread Management JIT compilation Object Allocation Garbage Collection Java Flame Chart Conclusion POLYTECHNIQUE MONTREAL – Houssem Daoud

Garbage Collection The garbage collector reclaims unused memory by automatically removing unreachable objects Characteristics of garbage collectors Serial / Parallel Concurrent / Stop-the-world Compacting / Non-Compacting Young generation Promotion Old generation POLYTECHNIQUE MONTREAL – Houssem Daoud

Garbage Collection report_gc_start and report_gc_end provide information about the garbage collection (start, end, major/minor, type) alloc_requiring_gc indicates the thread that caused the garbage collection POLYTECHNIQUE MONTREAL – Houssem Daoud

Garbage Collection By adding the userspace callstack context to garbage collector events, it is possible know the reason and the type of triggered GCs POLYTECHNIQUE MONTREAL – Houssem Daoud

Agenda Introduction Thread Management JIT compilation Object Allocation Garbage Collection Java Flame Chart Conclusion POLYTECHNIQUE MONTREAL – Houssem Daoud

Java Flame Chart We are able to get the flame chart of a java program by instrumenting methods entry/exit (high frequency event) POLYTECHNIQUE MONTREAL – Houssem Daoud

Conclusion We instrumented Hotspot JVM We used Kernel/User-space traces to provide an advanced performance analysis tool for Java applications The analysis covers JIT compilation, object allocation, garbage collection and method invocation. POLYTECHNIQUE MONTREAL – Houssem Daoud

Thank You ! POLYTECHNIQUE MONTREAL – Houssem Daoud