You are on page 1of 59

Java VM for server-side use

BEA-JRockit

Sebastian Steinhauer

Content
Why BEA-JRockit seems to be interesting?
What is a Java platform
Components of a Java platform
JBC Assembler for JVM

What to find inside a JVM?


Building Plan
Processing a snippet of code

Basic principals of JVMs.


JIT Compiler vs. Interpretation
Garbage collection using Suns JVM
Characteristics of a Server JVM

BEA - JRockit
Just-in-time compilation
Garbage Collection

Wrap-up
Sources
HPI, Seminar System Modeling - SS2005 / 2

Why BEA-JRockit seems to be interesting?


JBoss has self-certified on BEA
JRockit
Intel and BEA have collaborated closely
in the development of the JRockit JVM
Intel Itanium 2
Intel Xeon

SPECjbb2000
105296 ops/s (BEA, PowerEdge 6650)
103371 ops/s (IBM, xSeries x346 )

Zero-Overhead Monitoring of JVM

HPI, Seminar System Modeling - SS2005 / 3

Why BEA-JRockit seems to be interesting?


JBoss has self-certified on BEA
JRockit
Intel and BEA have collaborated closely
in the development of the JRockit JVM
Intel Itanium 2
Intel Xeon

SPECjbb2000
105296 ops/s (BEA, PowerEdge 6650)
103371 ops/s (IBM, xSeries x346 )

Zero-Overhead Monitoring of JVM

HPI, Seminar System Modeling - SS2005 / 3

Why BEA-JRockit seems to be interesting?


JBoss has self-certified on BEA
JRockit
Intel and BEA have collaborated closely
in the development of the JRockit JVM
Intel Itanium 2
Intel Xeon

SPECjbb2000
105296 ops/s (BEA, PowerEdge 6650)
103371 ops/s (IBM, xSeries x346 )

Zero-Overhead Monitoring of JVM

HPI, Seminar System Modeling - SS2005 / 3

Why BEA-JRockit seems to be interesting?


JBoss has self-certified on BEA
JRockit
Intel and BEA have collaborated closely
in the development of the JRockit JVM
Intel Itanium 2
Intel Xeon

SPECjbb2000
105296 ops/s (BEA, PowerEdge 6650)
103371 ops/s (IBM, xSeries x346 )

Zero-Overhead Monitoring of JVM

HPI, Seminar System Modeling - SS2005 / 3

Why BEA-JRockit seems to be interesting?


JBoss has self-certified on BEA
JRockit
Intel and BEA have collaborated closely
in the development of the JRockit JVM
Intel Itanium 2
Intel Xeon

SPECjbb2000
105296 ops/s (BEA, PowerEdge 6650)
103371 ops/s (IBM, xSeries x346 )

Zero-Overhead Monitoring of JVM

HPI, Seminar System Modeling - SS2005 / 3

What is a Java platform ?

Sebastian Steinhauer

Components of a Java platform


IDE
javac
JavaDoc
Debugger
Profiler
JVM

Profiler
Classlibs
Java API

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 5

JVM

Java Byte Code Assembler for JVM

b= a+ c*d ;
Profiler
Classlibs
Java API

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

JVM

Java Byte Code Assembler for JVM


OpCode

b= a+ c*d ;

0x15 (21)
x00 (0)
0x15 (21)
0x02 (2)
0x15 (21)
0x04 (3)

Profiler
Classlibs
Java API

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

JVM

0x68 (104)
0x60 (96)
0x36 (54)
0x01 (1)

Java Byte Code Assembler for JVM


Mnemonics

b= a+ c*d ;

0x15 (21)
x00 (0)
0x15 (21)
0x02 (2)
0x15 (21)
0x04 (3)

Profiler
Classlibs
Java API

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

OpCode

JVM

0x68 (104)
0x60 (96)
0x36 (54)
0x01 (1)

Java Byte Code Assembler for JVM

b= a+ c*d ;
Profiler
Classlibs
Java API

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

Mnemonics

OpCode

iload a

0x15 (21)
x00 (0)
0
15 (21)
0x15
0x02 (2)
0x15 (21)
0x04 (3)

JVM

0x68 (104)
0x60 (96)
0x36 (54)
0x01 (1)

Java Byte Code Assembler for JVM

b= a+ c*d ;
Profiler

javac

Java Byte
Code
Java
Source
Code

IDE

OpCode

iload a

0x15 (21)
x00 (0)
0 15 (21)
0x15
0x02 (2)
0x15
0
15 (21)
0x04 (3)

iload c
Classlibs
Java API

Developer

Mnemonics

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

JVM

0x68 (104)
0x60 (96)
0x36 (54)
0x01 (1)

Java Byte Code Assembler for JVM

b= a+ c*d ;
Profiler

Mnemonics

OpCode

iload a

0x15 (21)
x00 (0)
0 15 (21)
0x15
0x02 (2)
0 15 (21)
0x15
0x04 (3)

iload c
Classlibs
Java API

iload d

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

JVM

0x68 (104)
0x60 (96)
0x36 (54)
0x01 (1)

Java Byte Code Assembler for JVM

b= a+ c*d ;
Profiler

Mnemonics

OpCode

iload a

0x15 (21)
x00 (0)
0 15 (21)
0x15
0x02 (2)
0 15 (21)
0x15
0x04 (3)

iload c
Classlibs
Java API

iload d

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

JVM

imul

0x68 (104)
0x60 (96)
0x36 (54)
0x01 (1)

Java Byte Code Assembler for JVM

b= a+ c*d ;
Profiler

Mnemonics

OpCode

iload a

0x15 (21)
x00 (0)
0 15 (21)
0x15
0x02 (2)
0 15 (21)
0x15
0x04 (3)

iload c
Classlibs
Java API

iload d

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

JVM

imul
iadd

0x68 (104)
0x60 (96)
0x36 (54)
0x01 (1)

Java Byte Code Assembler for JVM

b= a+ c*d ;
Profiler

Mnemonics

OpCode

iload a

0x15 (21)
x00 (0)
0 15 (21)
0x15
0x02 (2)
0 15 (21)
0x15
0x04 (3)

iload c
Classlibs
Java API

iload d

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

JVM

imul
iadd

0x68 (104)
0x60 (96)

istore b

0x36 (54)
0x01 (1)

Java Byte Code Assembler for JVM

b= a+ c*d ;
Profiler

Mnemonics

OpCode

iload a

0x15 (21)
x00 (0)
0 15 (21)
0x15
0x02 (2)
0 15 (21)
0x15
0x04 (3)

iload c
Classlibs
Java API

iload d

javac

Java Byte
Code
Java
Source
Code

Developer

IDE

Debugger

CodeDocu

JavaDoc

HPI, Seminar System Modeling - SS2005 / 6

JVM

imul
iadd

0x68 (104)
0x60 (96)

istore b

0x36 (54)
0x01 (1)

Inside the Java VM

Sebastian Steinhauer

What to find inside a JVM? Building Plan


GC

Thread
Frame
Pointer

OnTop
Op.Stack

PC

Vars
Pointer
Heap

JITC

Native Methods
Stack

Const. Pool
Name
Resolver
Control Unit
Method . Area

Locals

Operands
Stack

Native
Byte Code Processor

Frame
JBC

Frame

Frame

ALU

JAVA (Frame) Stack


Initial Class Loader

I/O (OS)

HPI, Seminar System Modeling - SS2005 / 8

Thread Controller

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack
Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a
Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a
Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a
Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a
Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a
Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d
imul

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a
Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d
imul

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a

iadd
Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d
imul

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a

iadd
istore b

Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d
imul

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

b
a

iadd
istore b

Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d
imul

Locals

Operands Stack
Control Unit

d
c
b

Byte Code Processor

iadd
istore b

Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d
imul

Locals

Operands Stack
Control Unit

d
c

Byte Code Processor

iadd
istore b

Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d
imul

Locals

Operands Stack
Control Unit

d
c

c*d
c

Byte Code Processor

iadd
istore b

Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Inside a JVM - Processing a snippet of code


JAVA (Frame) Stack

b=a+c*d;
iload a
iload c
iload d
imul

Locals

Operands Stack
Control Unit

d
c

c*d
c

c*d+a
a

Byte Code Processor

iadd
istore b

Frame
Frame
Frame

HPI, Seminar System Modeling - SS2005 / 9

ALU

Principals of JVM

Sebastian Steinhauer

1000x ops/s

Basic principals of JVMs - JIT Compiler vs. Interpretation

HPI, Seminar System Modeling - SS2005 / 11

[ETHZ]

1000x ops/s

Basic principals of JVMs - JIT Compiler vs. Interpretation


[ETHZ]

iload a

iload c

iload d

imul

iadd

istore b

HPI, Seminar System Modeling - SS2005 / 11

1000x ops/s

Basic principals of JVMs - JIT Compiler vs. Interpretation


[ETHZ]

iload a

PUSH EAX
MOV EAX,a

iload c

PUSH EAX
MOV EAX,c

iload d

PUSH EAX
MOV EAX,d

imul

POP EBX
IMUL EBX

iadd

POP EBX
ADD EAX,EBX

istore b

MOVE b,EAX
POP EAX

HPI, Seminar System Modeling - SS2005 / 11

1000x ops/s

Basic principals of JVMs - JIT Compiler vs. Interpretation


[ETHZ]

iload a

PUSH EAX
MOV EAX,a

MOV EAX,a

iload c

PUSH EAX
MOV EAX,c

MOV EBX,c

iload d

PUSH EAX
MOV EAX,d

MOV ECX,d

imul

POP EBX
IMUL EBX

IMUL EBX,ECX

iadd

POP EBX
ADD EAX,EBX

ADD EAX,EBX

istore b

MOVE b,EAX
POP EAX

MOVE b,EAX

HPI, Seminar System Modeling - SS2005 / 11

1000x ops/s

Basic principals of JVMs - JIT Compiler vs. Interpretation


[ETHZ]

iload a

PUSH EAX
MOV EAX,a

MOV EAX,a

iload c

PUSH EAX
MOV EAX,c

MOV EBX,c

iload d

PUSH EAX
MOV EAX,d

MOV ECX,d

imul

POP EBX
IMUL EBX

IMUL EBX,ECX

iadd

POP EBX
ADD EAX,EBX

ADD EAX,EBX

istore b

MOVE b,EAX
POP EAX

MOVE b,EAX

HPI, Seminar System Modeling - SS2005 / 11

Basic principals of JVMs - JIT Compiler vs. Interpretation


1000x ops/s

[ETHZ]

iload a

PUSH EAX
MOV EAX,a

MOV EAX,a

iload c

PUSH EAX
MOV EAX,c

MOV EBX,c

iload d

PUSH EAX
MOV EAX,d

MOV ECX,d

imul

POP EBX
IMUL EBX

IMUL EBX,ECX

iadd

POP EBX
ADD EAX,EBX

ADD EAX,EBX

Pro

Platform
independency
istore b
MOVE b,EAX
Performance
POP EAX
Platformcharacteristics
HPI, Seminar System Modeling - SS2005 / 11

MOVE b,EAX

Basic principals of JVMs - JIT Compiler vs. Interpretation


1000x ops/s

[ETHZ]

iload a

PUSH EAX
MOV EAX,a

MOV EAX,a

iload c

PUSH EAX
MOV EAX,c

MOV EBX,c

iload d

PUSH EAX
MOV EAX,d

MOV ECX,d

imul

POP EBX
IMUL EBX

IMUL EBX,ECX

iadd

POP EBX
ADD EAX,EBX

ADD EAX,EBX

Pro

Platform
independency
istore b
MOVE b,EAX
Performance
POP EAX
Platformcharacteristics
HPI, Seminar System Modeling - SS2005 / 11

Contra
Single use compilation
Fast, suboptimal compilation
Recompiling (every run)

MOVE b,EAX

Basic principals of JVMs - Garbage collection using Suns JVM


GC

Thread
Registers

Obj.3 Obj.
Locals

Operands
Stack

Obj.1

Heap

Obj.2
Native Methods
Stack

Obj.
Ref.
0

Obj.

Byte Code
Processor
Const. Pool

Frame
Frame

Frame

Method . Area

JAVA (Frame ) Stack

Native

JBC

HPI, Seminar System Modeling - SS2005 / 12

Thread Controller

Basic principals of JVMs - Garbage collection using Suns JVM


GC

Thread
Registers

Obj.3 Obj.
Locals

Operands
Stack

Obj.1

Obj.
Ref.
2

Heap

Obj.2
Native Methods
Stack

Obj.
Ref.
0

Obj.

Byte Code
Processor
Const. Pool

Frame
Frame

Frame

Method . Area

JAVA (Frame ) Stack

Native

JBC

HPI, Seminar System Modeling - SS2005 / 12

Thread Controller

Basic principals of JVMs - Garbage collection using Suns JVM


GC

Thread
Registers

Obj.0 Obj.3 Obj.


Locals

Operands
Stack

Obj.1

Obj.
Ref.
2

Heap

Obj.2
Native Methods
Stack

Obj.
Ref.
0

Obj.

Byte Code
Processor
Const. Pool

Frame
Frame

Frame

Method . Area

JAVA (Frame ) Stack

Native

JBC

HPI, Seminar System Modeling - SS2005 / 12

Thread Controller

Basic principals of JVMs - Garbage collection using Suns JVM


GC

Thread
Registers

Obj.0 Obj.3 Obj.


Locals

Operands
Stack

Obj.1

Obj.
Ref.
2

Heap

Obj.2
Native Methods
Stack

Obj.
Ref.
0

Obj.

Byte Code
Processor
Const. Pool

Frame
Frame

Frame

Method . Area

JAVA (Frame ) Stack

Native

JBC

HPI, Seminar System Modeling - SS2005 / 12

Thread Controller

Basic principals of JVMs - Garbage collection using Suns JVM


GC

Thread
Registers

Obj.0 Obj.3 Obj.


Locals

Operands
Stack

Obj.1

Obj.
Ref.
2

Heap

Obj.4

Obj.2
Native Methods
Stack

Obj.
Ref.
0

Obj.

Byte Code
Processor
Const. Pool

Frame
Frame

Frame

Method . Area

JAVA (Frame ) Stack

Native

JBC

HPI, Seminar System Modeling - SS2005 / 12

Thread Controller

Basic principals of JVMs - Garbage collection using Suns JVM


GC

Thread
Registers

Obj.0 Obj.3 Obj.


Locals

Operands
Stack

Obj.1

Obj.
Ref.
2

Heap

Obj.4

Obj.2
Native Methods
Stack

Obj.
Ref.
0

Obj.

Byte Code
Processor
Const. Pool

Frame
Frame

Frame

Method . Area

JAVA (Frame ) Stack

Native

JBC

HPI, Seminar System Modeling - SS2005 / 12

Thread Controller

Basic principals of JVMs - Garbage collection using Suns JVM


GC

Thread
Registers

Obj.0 Obj.3 Obj.


Locals

Operands
Stack

Obj.1

Obj.
Ref.
2

Heap

Obj.4

Obj.2
Native Methods
Stack

Obj.
Ref.
0

Obj.

Obj.

Byte Code
Processor
Const. Pool

Frame
Frame

Frame

Method . Area

JAVA (Frame ) Stack

Native

JBC

HPI, Seminar System Modeling - SS2005 / 12

Thread Controller

Basic principals of JVMs - Garbage collection using Suns JVM


GC

Thread
Registers

Obj.0 Obj.3 Obj.


Locals

Operands
Stack

Obj.1

Obj.
Ref.
2

Heap

Obj.4

Obj.2
Native Methods
Stack

Obj.
Ref.
0

Obj.

Obj.

Byte Code
Processor
Const. Pool

Frame
Frame

Frame

Method . Area

JAVA (Frame ) Stack

Native

JBC

HPI, Seminar System Modeling - SS2005 / 12

Thread Controller

Basic principals of JVMs - Characteristics of a Server JVM


Multiprocessor maschines (128 CPU)
64bit adressable memory (288 Gbyte)
Longer time slices
Reliability (monitoring and logging)
Heterogeneous software infrastructure
Long running time
Performance

HPI, Seminar System Modeling - SS2005 / 13

BEA-JRockit

the fastest server-side JVM

Sebastian Steinhauer

BEA JRockit - JITC/ Dynamic code replacement

... an application will typically spend 99% percent of its


excecution time in about 10% of its methods.
HPI, Seminar System Modeling - SS2005 / 15

[BEA]

BEA JRockit - JITC/ Dynamic code replacement

... an application will typically spend 99% percent of its


excecution time in about 10% of its methods.
HPI, Seminar System Modeling - SS2005 / 15

[BEA]

BEA JRockit - Thread management


Thin threads

Native threads

experimental feature

well known

mapping of several thin threads


upon one native thread

maping upon processors

light weight context switching

context switching is done by


operating system

better memory utilization

scheduled by OS

can move between different OSthread

faster on multiprocessor systems

can be mapped upon hypertheads


(intel)

HPI, Seminar System Modeling - SS2005 / 16

BEA JRockit - Garbage Collection

4 different implementations
parallel garbage collection
generational garbage collection
single spaced garbage collection
concurrent garbage collection

dynamic selection algorithm


dynamic heap size adaption

HPI, Seminar System Modeling - SS2005 / 17

Wrap-up
Platform independency by intermediate byte code
Bytecode processing via interpretation and JIT compiling
dynamic code replacement
progressive optimization

Garbage collected heap


different implementations

Scalability
Powerfull IDE/JRE
Server JVM

HPI, Seminar System Modeling - SS2005 / 18

References
http://www.intel.com/cd/ids/developer/asmo-na/eng/198984.htm?page=1
Stand: 2005-04-28
http://www.bea.com/framework.jsp?CNT=features.htm
Stand: 2005-04-28
http://www.jboss.com/products/jbossas
Stand: 2005-04-28
http://www.spec.org/jbb2000/results/res2005q1/
Stand: 2005-04-28
Selecting and Running a Thread System, BEA Systems Inc.
Selecting and Running an Memory Managment System, BEA Systems Inc.
BEA-JRockit: Java for the Enterprise, BEA Systems Inc.
BEA Weblogic JRockit, BEA Systems Inc.
Die virtuelle Java Maschine, Linux-Magazin, 1997/06
Javas garbage-collected heap, Java World, 1996/08
JVM Performance Analysis, ETHZ, WS 1999/2000
Kompilation, JIT-Kompilation, FH-WEDEL, WS 2002
The Java Virtual Maschine Specification Second Edition,
Sun Microsystems Inc.

HPI, Seminar System Modeling - SS2005 / 19

Java VM for server-side use


BEA-JRockit
any further Questions ?

Sebastian Steinhauer

You might also like