55
Eva Andreasson Product Manager, Azul Systems A JVM Does What?

A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

Eva Andreasson

Product Manager, Azul Systems

A JVM Does What?

Page 2: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 2

Presenter

• Eva Andreasson – Innovator & Problem solver ─ Implemented the Deterministic GC of JRockit Real Time

─ Awarded patents on GC heuristics and self-learning algorithms

─ Most recent: Product Manager for Azul Systems’ scalable Java Platform Zing

• I like new ideas and brave thinking!

Page 3: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 3

Agenda

• What is a JVM?

• What the JVM enables for Java

• Compilers and optimization

• Garbage collection and the pain of fragmentation

• What to (not) think about

Page 4: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 4

What is a Java Virtual Machine (JVM)?

• Java ─ But these days JVMs can handle other dynamic languages too

(Scala, Groovy, Clojure…)

• Virtual ─ A great abstraction that allows programmers to focus on value-

add elsewhere

• Machine ─ Manages resources and instruction execution

Page 5: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 5

What is a Java Virtual Machine (JVM)?

• A JVM described in a simple sentence

A software module that provides the same execution environment to all Java applications, and takes care of the “translation” to the underlying layers with regards to execution of instructions and resource management.

Page 6: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 6

What is a Java Virtual Machine (JVM)?

• Key benefits of Java, enabled by the JVM ─ Portability

─ “Non-explicity”

• Other error-preventing and convenient services of the JVM

─ Consistent Thread Model

─ Optimizes and Manages Locking

─ Enforces Type Safety

─ Dynamic Code Loading

─ Quick high-quality Time Access (e.g. currentTimeMillis, nanoTime)

─ Internal introspection

─ Access to huge pre-built library

─ Access to OS and environmental information

Page 7: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 7

What is a Java Virtual Machine (JVM)?

• Key benefits of Java, enabled by the JVM ─ Portability

─ “Non-explicity”

• Other error-preventing and convenient services of the JVM

─ Consistent Thread Model

─ Optimizes and Manages Locking

─ Enforces Type Safety

─ Dynamic Code Loading

─ Quick high-quality Time Access (e.g. currentTimeMillis, nanoTime)

─ Internal introspection

─ Access to huge pre-built library

─ Access to OS and environmental information

Page 8: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 8

Portability Write once, run everywhere

Hardware

Architecture

Operating

System

JVM

Java

Application

Hardware

Architecture

Operating

System

JVM

Java

Application

Same code!

Page 9: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 9

What Makes Portability Possible?

• javac – takes Java source code compiles it into bytecode ─ MyApp.java MyApp.class

• Bytecode can be “translated” by JVMs into HW instructions

─ Anywhere the JVM runs…

• Two paths of “translation” ─ Interpretation

─ The “dictionary” approach

─ Look up instruction, execute

─ Compilation (JIT) ─ The “intelligent translator”

─ Profile, analyze, execute faster

Page 10: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 10

JVM Compilers

• Common concepts: ─ Hotspot detection, Re-compilation, and De-compilation

• Optimizations need resources ─ Temporary “JVM memory”

─ “Compiler threads”

─ Cost is covered by the faster execution time

• Different compilers for different needs ─ Client (“C1”), quicker compilation time, less optimized code

─ Server (“C2”), slower compilation time, more optimized code

─ Tiered, both C1 and C2

─ C1’s profiling used for C2’s compilation

Page 11: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 11

Exploring JIT Compilation Example 1: Dead Code Elimination

• Eliminates code that does not affect the program

• The compiler finds the “dead” code and eliminates the instruction set for it

─ Reduces the program size

─ Prevents irrelevant operations to occupy time in the CPU

• Example:

int timeToScaleMyApp(boolean endlessOfResources) {

int reArchitect = 24;

int patchByClustering = 15;

int useZing = 2;

if (endlessOfResources)

return reArchitect + useZing;

else

return useZing;

}

Page 12: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 12

Exploring JIT Compilation Example 1: Dead Code Elimination

• Eliminates code that does not affect the program

• The compiler finds the “dead” code and eliminates the instruction set for it

─ Reduces the program size

─ Prevents irrelevant operations to occupy time in the CPU

• Example:

int timeToScaleMyApp(boolean endlessOfResources) {

int reArchitect = 24;

int useZing = 2;

if (endlessOfResources)

return reArchitect + useZing;

else

return useZing;

}

Page 13: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 13

int daysLeft(int x) {

if (x == 0)

return 0;

else

return x - 1;

}

int whenToEvaluateZing(int y) {

return daysLeft(y) + daysLeft(0) + daysLeft(y+1);

}

Each method call

takes time, and causes

extra jump instructions

to be executed

Exploring JIT Compilation Example 2: Inlining

Page 14: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 14

int whenToEvaluateZing(int y) {

int temp = 0;

if (y == 0) temp += 0; else temp += y - 1;

if (0 == 0) temp += 0; else temp += 0 - 1;

if (y+1 == 0) temp += 0; else temp += (y + 1) - 1;

return temp;

}

Eliminating multiple method

calls by inlining the method

itself, speeds up the

execution

Exploring JIT Compilation Example 2: Inlining

Page 15: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 15

int whenToEvaluateZing(int y) {

if (y == 0) return y;

else if (y == -1) return y - 1;

else return y + y - 1;

}

Further optimizations can

often be applied to speed up

even more….

Exploring JIT Compilation Example 2: Inlining

Page 16: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 16

• Common situation after inlining: ─ Method “foo” inlined in multiple places

─ Could lead to execution of the same tasks multiple times ─ Assignment of values to variables

─ Additions or other operations

─ Other…

─ Optimize to only have to do the redundant instructions once

• Elimination of redundancy speeds up the code execution

Exploring JIT Compilation Example 2: Redundancy Removal

Page 17: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 17

Summary on Portability and Compilers

• Since the JVM Compiler does the “translation” and optimization for you, you don’t need to think about:

─ Different HW instruction sets

─ How to write your methods in a more instruction friendly way

─ How calls to other methods may impact execution performance

• Unless you want to?

Page 18: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 18

What is a Java Virtual Machine (JVM)?

• Key benefits of Java, enabled by the JVM ─ Portability

─ “Non-explicity”

• Other error-preventing and convenient services of the JVM

─ Consistent Thread Model

─ Optimizes and Manages Locking

─ Enforces Type Safety

─ Dynamic Code Loading

─ Quick high-quality Time Access (e.g. currentTimeMillis, nanoTime)

─ Internal introspection services

─ Access to huge pre-built library

─ Access to OS and environmental information

Page 19: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 19

What is a Java Virtual Machine (JVM)?

• Key benefits of Java, enabled by the JVM ─ Portability

─ “Non-explicity”

• Other error-preventing and convenient services of the JVM

─ Consistent Thread Model

─ Optimizes and Manages Locking

─ Enforces Type Safety

─ Dynamic Code Loading

─ Quick high-quality Time Access (e.g. currentTimeMillis, nanoTime)

─ Internal introspection services

─ Access to huge pre-built library

─ Access to OS and environmental information

Page 20: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 20

Non-Explicity

import java.io.*;

class ZingFan {

private String myName;

public ZingFan(String name){

myName = name;

}

public String getName() {

return myName;

}

public static void main (String args[ ]){

ZingFan me = new ZingFan("Eva");

System.out.println(me.getName());

}

}

Just type “new” to

get the memory you

need

No need to track or

free used memory!

Page 21: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 21

Garbage Collection

• Dynamic Memory Management – The perceived pain that really comes with all the goodness

• Allocation and Garbage Collection ─ Parallel

─ Concurrent

─ Generational

─ Fragmentation and Compaction

─ The torture of tuning most JVMs

Page 22: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 22

Allocation & Garbage Collection

• Java Heap (-Xmx)

• JVM Internal Memory

• Top: RES / RSS --- total memory footprint

Java Heap • Where all Java Objects are allocated

JVM Internal

Memory • Code Cache

• VM threads

• VM Structs

• GC Memory

Page 23: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 23

Old

Object

Old

Object

Allocation & Garbage Collection

• Thread Local Allocation • Thread Local Allocation Buffers (TLABs) to avoid heap locks

TLAB for thread B

Object

Bar

TLAB for thread A

Java Heap

Thread A

Thread B

Object Foo

Page 24: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 24

Object Foo

Object

Bar

Old

Object

Old

Object

Allocation & Garbage Collection

• Miss fitted TLAB sizes cause fragments • Can be tuned on the command line, but be careful to not tune yourself into a rigid corner…

TLAB for thread B TLAB for thread A

Java Heap

Thread A

Thread B

Page 25: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 25

Object

NoFit

Old

Object Object Foo

Object

Bar

Old

Object

Allocation & Garbage Collection

• Garbage Collection • Happens when the heap is “full”

Java Heap ???

Thread B

Thread A

Reference

Page 26: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 26

Object Foo

Object

Bar

Garbage Collection

• Parallel Garbage Collection ─ Stop the world

Java Heap

Object

NoFit

Thread B

Reference

Old

Object

Old

Object

GC Thread

Page 27: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 27

Old

Object

Old

Object Object Foo

Garbage Collection

• Parallel Garbage Collection ─ Stop the world

Java Heap

Object

NoFit

Thread B

Reference

Object

Bar

GC Thread

Page 28: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 28

Old

Object

Old

Object

Garbage Collection

• Parallel Garbage Collection ─ Stop the world

Java Heap

Object

NoFit

Thread B

Reference

Object Foo

Object

Bar

GC Thread

Page 29: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 29

Garbage Collection

• Parallel Garbage Collection ─ Stop the world

Java Heap

Object

NoFit

Thread B

Reference

Object Foo

Object

Bar

GC Thread

Page 30: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 30

Garbage Collection

• Parallel Garbage Collection ─ Stop the world

Java Heap

Thread B

Thread A

Reference

Object Foo

Object

Bar

Object

NoFit

Page 31: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 31

Garbage Collection

• Parallel Garbage Collection ─ Stop the world

Java Heap

Thread B

Thread A

Reference

Object Foo

Object

Bar

Object

NoFit

Page 32: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 32

Garbage Collection

• Concurrent Garbage Collection ─ While application is running

Java Heap

Old

Object Object

Bar

Old

Object

Object Foo

Thread B

GC Thread

Reference

Page 33: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 33

Garbage Collection

• Concurrent Garbage Collection ─ While application is running

Java Heap

Old

Object Object

Bar

Old

Object

Thread B

GC Thread

Object Foo

Reference

Page 34: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 34

Garbage Collection

• Concurrent Garbage Collection ─ While application is running

Java Heap

Old

Object Object

Bar

Old

Object

Thread B

GC Thread

Object Foo

Reference

Page 35: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 35

Garbage Collection

• Concurrent Garbage Collection ─ While application is running

Java Heap

Object

Bar

Old

Object

Thread B

GC Thread

Object Foo

Reference

Page 36: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 36

Fragmentation

• When there is room on the heap ─ But not large enough…

─ Even after GC…

Java Heap

Older

Object Object

Bar

Object

NoFit

Thread B

Object Foo

???

Page 37: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 37

Older

Object

Object

Bar Object Foo

Generational Garbage Collection

• Most objects die young…

Java Heap

Thread B

???

Old Generation Young Generation

Object

NoFit

Page 38: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 38

Older

Object

Object

Bar Object Foo

Generational Garbage Collection

• Most objects die young…

Java Heap

Thread B

???

Old Generation Young Generation

Object

NoFit

Page 39: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 39

Older

Object

Generational Garbage Collection

• Most objects die young…

Java Heap

Thread B

Old Generation Young Generation

Object

NoFit

Page 40: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 40

Older

Object

Generational Garbage Collection

• Most objects die young…

Java Heap

Thread B

Old Generation Young Generation

Object

NoFit

Page 41: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 41

Generational Garbage Collection

• Promotion

Java Heap

Older

Object

Object

NoFit Many Young Objects

Thread B Object

YGCTrig ???

Old Generation Young Generation

Page 42: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 42

Generational Garbage Collection

• Promotion

Java Heap

Older

Object Object

NoFit Many Young Objects

Thread B Object

YGCTrig ???

Old Generation Young Generation

• Less fragmented memory

• Delays “worst case”

Page 43: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 43

Generational Garbage Collection

• Promotion

Java Heap

Older

Object Object

NoFit

Thread B Object

YGCTrig

Old Generation Young Generation

• Less fragmented memory

• Delays “worst case”

Page 44: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 44

Generational Garbage Collection

• Promotion

Java Heap

Older

Object Object

NoFit

Thread B

Object

YGCTrig

Old Generation Young Generation

• Less fragmented memory

• Delays “worst case”

Page 45: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 45

Compaction

• Move objects together ─ To fit larger objects

─ Eliminate small un-useful memory gaps

Java Heap

Older

Object

Object

Bar Object

NoFit Object Foo

???

Old Generation Young Generation

Page 46: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 46

Compaction

• Move objects together ─ To fit larger objects

─ Eliminate small un-useful memory gaps

Java Heap

Older

Object Object

Bar

Object

NoFit Object Foo

Old Generation Young Generation

Page 47: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 47

Compaction

• Move objects together ─ To fit larger objects

─ Eliminate small un-useful memory gaps

Java Heap

Older

Object Object

Bar

Object

NoFit Object Foo

Old Generation Young Generation

Page 48: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 48

Compaction

• Generational GC helps delay, but does not “solve” fragmentation

• Compaction is inevitable ─ When moving objects, you need to update references

─ Most JVMs have to stop the world as part of compaction

• Many approaches to shorten compaction impact ─ Partitioned compaction

─ Time controlled compaction

─ “Best result” calculations on what areas to compact

─ Reference counting

Page 49: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 49

Pain of Tuning

• -Xmx – hast to be set “right” ─ Exactly the amount you need for your worst case load

─ Too much – waste of resources

─ Too little – OutOfMemoryError

─ Unpredictable loads and missconfiguration cause a lot of down-time

─ People tune to postpone worst-case!!

• Example of production-tuned CMS:

Page 50: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 50

Biggest Java Scalability Limitation

• For MOST JVMs, compaction pauses are the biggest current challenge and key limiting factor to Java scalability

• The larger heap and live data / references to follow, the bigger challenge for compaction

• Today: most JVMs limited to 3-4GB ─ To keep “FullGC” pause times within SLAs

─ Design limitations to make applications survive in 4GB chunks

─ Horizontal scale out / clustering solutions

─ In spite of machine memory increasing over the years…

This is why I find Zing so interesting, as it has implemented concurrent compaction…

─ But that is not the topic of this presentation…

Page 51: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 51

2c for the Road What to (not) Think About

1. Why not use multiple threads, when you can? ─ Number of cores per server continues to grow…

2. Don’t be afraid of garbage, it is good!

3. I personally don’t like finalizers…error prone, not guaranteed to run (resource wasting)

4. Always be careful around locking ─ If it passes testing, hot locks can still block during production load

5. Benchmarks are often focused on throughput, but miss out on real GC impact – test your real application! ─ “Full GC” never occurs during the run, not running long enough to

see impact of fragmentation

─ Response time std dev and outliers (99.9…%) are of importance for a real world app, not throughput alone!!

Page 52: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 52

Summary

• JVM – a great abstraction, provides convenient services so the Java programmer doesn’t have to deal with environment specific things

• Compiler – “intelligent and context-aware translator” who helps speed up your application

• Garbage Collector – simplifies memory management, different flavors for different needs

• Compaction – an inevitable task, which impact grows with live size and data complexity for most JVMs, and the current largest limiter of Java Scalability

Page 53: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 53

For the Curious: What is Zing?

• Azul Systems has developed scalable Java platforms for 8+ years

─ Vega product line based on proprietary chip architecture, kernel enhancements, and JVM innovation

─ Zing product line based on x86 chip architecture, virtualization and kernel enhancements, and JVM innovation

• Most famous for our Generational Pauseless Garbage Collector, which performs fully concurrent compaction

Page 54: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 54

Q&A

[email protected]

http://twitter.com/AzulSystemsPM

www.azulsystems.com/zing

Page 55: A JVM Does What? - Azul | Better Java Performance ... · Architecture Operating System JVM Java Application Hardware Architecture Operating System JVM Java Application Same code!

©2011 Azul Systems, Inc. 55

Additional Resources

• For more information on… …JDK internals: http://openjdk.java.net/ (JVM source code)

…Memory management: http://java.sun.com/j2se/reference/whitepapers/memorymanagement_whitepaper.pdf (a bit old, but very comprehensive)

…Tuning: http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/tune_stable_perf.html (watch out for increased rigidity and re-tuning pain)

…Generational Pauseless Garbage Collection: http://www.azulsystems.com/webinar/pauseless-gc (webinar by Gil Tene, 2011)

…Academic paper on C4 (email Eva and you will get a copy)

…Compiler internals and optimizations: http://www.azulsystems.com/blogs/cliff (Dr Cliff Click’s blog)