SlideShare a Scribd company logo
JVM Internals 
FTD Group
acknowledgment 
● God 
● iMasters 
● FTD Group
who we are? 
FTD Group 
http://friendstechday.wordpress.com/about/
JVM? WORA? What?
Java Virtual Machine 
● The Java Virtual Machine Specification 
● Written in C/C++ 
● Stack based VM 
● Different implementations 
● Symbolic reference 
● Garbage Collected 
● Java Bytecode 
● JIT (Just-In-Time)
Stack based VM
1 + 2 = ?
(+ 1 2) 
Lisp? RPN?
operand stack 
PUSH 1 1 
1 
PUSH 2 2 
ADD 3
operand stack - bytecode 
iconst_1 1 
1 
iconst_2 2 
iadd 3
Java bytecode is the instruction set 
of the Java virtual machine 
opcode = 1 or 2 bytes 
256 possible opcodes 
198 are currently in use 
51 are reserved for future use 
3 are set aside as permanently unimplemented 
list of all opcodes: http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html
variable declaration 
int i; 
0: iconst_0 // push 0 to top of the operand stack 
1: istore_1 // Pop value from top of operand stack and 
store as local variable 1
object instantiation 
Object ftd = new Object(); 
0: new #2 // Class java/lang/Object 
1: dup // duplicate the value on top of the stack 
2: invokespecial #3 // Method java/lang/Object “<init>()V”
#1, #4, #100? #Wat?
Runtime Constant Pool 
The constant pool contains the following 
types: 
● Integer, Long, Float, Double 
● String, Uft8 
● Class 
● NameAndType 
● Fieldref, Methodref, InterfaceMethodref
Java Bytecode Type Description 
B byte signed byte 
C char Unicode character 
D double double-precision floating-point value 
F float single-precision floating-point value 
I int integer 
J long long integer 
L<classname> reference an instance of class <classname> 
S short signed short 
Z boolean true or false 
[ reference one array dimension
Java Code Java Bytecode Expression 
double d[][][]; [[[D 
Object mymethod(int I, double d, Thread t) (IDLjava/lang/Thread;)Ljava/lang/Object;
javap -v SimpleClass
Not only Java Stack lives, 
but also Heap.
Java Heap memory
Code Cache 
used for compilation and storage of methods that 
have been compiled to native code by the JIT 
compiler
if >= java1.8 
no PermGen 
yes Metaspace
everything is wonderful 
in Java?.... it depends bro!
which the size of a Java 
String with "Java" 
content? 
String java = “Java”;
answer: 64 bytes 
Ahh… how.. WATTT???
Java memory consumption 
8 bytes Object Header 
8 bytes Object reference 
(x86 may use XX:+UseCompressedOops) 
8 bytes alignment (WAT?)
data alignment 
5 bytes used 3 bytes paddind 
8 bytes alignment
String explanation 
Field Type Size (bytes) 
HEADER 16 
value “Java” char[] (16 + 8) + (4 * 2) = 32 
offset int 4 
count int 4 
hash int 4 
PADDING = 60 + 4 
TOTAL 64 bytes
which the size of a java. 
lang.Boolean? 
Boolean b = false;
answer: 24 bytes 
Ahh… how.. WATTT???
Ok .. But what about 
classes? OOP?
Class File Format 
ClassFile { 
u4 magic; 
u2 minor_version; 
u2 major_version; 
u2 constant_pool_count; 
cp_info contant_pool[constant_pool_count – 1]; 
u2 access_flags; 
u2 this_class; 
u2 super_class; 
u2 interfaces_count; 
u2 interfaces[interfaces_count]; 
u2 fields_count; 
field_info fields[fields_count]; 
u2 methods_count; 
method_info methods[methods_count]; 
u2 attributes_count; 
attribute_info attributes[attributes_count]; 
}
javap -v SimpleClass
And what about the 
Classloader?
JVM initialization order 
1. Create a initial class using Bootstrap 
classloader; 
2. links the initial class; 
3. initializes it; 
4. and invokes the public class method void 
main(String[])
find, check headers class file, super loading, binary created 
3 steps, verifying and preparing the type and its direct supers 
structurally correct, and obeys the semantic requirements 
allocation of memory foe data structures 
(optional) checking corrected symbolic references 
executing initialization method <clinit>
Java debug without ide? 
Is it possible?
jdb 
(included in the JDK 1.2 
package)
THANK YOU! 
FTD Group 
JOIN US! 
“And be not conformed to this world: but be ye transformed by 
the renewing of your mind, that ye may prove what {is} that good, 
and acceptable, and perfect, will of God.” (Romans 12:2)

More Related Content

What's hot

Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeDmitri Nesteruk
 
Golang
GolangGolang
D programming language
D programming languageD programming language
D programming language
Jordan Open Source Association
 
The D Programming Language - Why I love it!
The D Programming Language - Why I love it!The D Programming Language - Why I love it!
The D Programming Language - Why I love it!
ryutenchi
 
Programming with Python - Adv.
Programming with Python - Adv.Programming with Python - Adv.
Programming with Python - Adv.
Mosky Liu
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
Markus Schneider
 
10 reasons to be excited about go
10 reasons to be excited about go10 reasons to be excited about go
10 reasons to be excited about go
Dvir Volk
 
Fantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptFantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptKamil Toman
 
Take advantage of C++ from Python
Take advantage of C++ from PythonTake advantage of C++ from Python
Take advantage of C++ from Python
Yung-Yu Chen
 
Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020
Yung-Yu Chen
 
Mono + .NET Core = ❤️
Mono + .NET Core =  ❤️Mono + .NET Core =  ❤️
Mono + .NET Core = ❤️
Egor Bogatov
 
Hands on Session on Python
Hands on Session on PythonHands on Session on Python
Hands on Session on Python
Sumit Raj
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go language
Tzar Umang
 
Writing Parsers and Compilers with PLY
Writing Parsers and Compilers with PLYWriting Parsers and Compilers with PLY
Writing Parsers and Compilers with PLY
David Beazley (Dabeaz LLC)
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
Positive Hack Days
 
OpenGurukul : Language : Python
OpenGurukul : Language : PythonOpenGurukul : Language : Python
OpenGurukul : Language : Python
Open Gurukul
 
Fscons scalable appplication transfers
Fscons scalable appplication transfersFscons scalable appplication transfers
Fscons scalable appplication transfers
Daniel Stenberg
 
A closure ekon16
A closure ekon16A closure ekon16
A closure ekon16
Max Kleiner
 
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Briefly Rust - Daniele Esposti - Codemotion Rome 2017Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Codemotion
 

What's hot (19)

Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
 
Golang
GolangGolang
Golang
 
D programming language
D programming languageD programming language
D programming language
 
The D Programming Language - Why I love it!
The D Programming Language - Why I love it!The D Programming Language - Why I love it!
The D Programming Language - Why I love it!
 
Programming with Python - Adv.
Programming with Python - Adv.Programming with Python - Adv.
Programming with Python - Adv.
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
 
10 reasons to be excited about go
10 reasons to be excited about go10 reasons to be excited about go
10 reasons to be excited about go
 
Fantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptFantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and Javascript
 
Take advantage of C++ from Python
Take advantage of C++ from PythonTake advantage of C++ from Python
Take advantage of C++ from Python
 
Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020
 
Mono + .NET Core = ❤️
Mono + .NET Core =  ❤️Mono + .NET Core =  ❤️
Mono + .NET Core = ❤️
 
Hands on Session on Python
Hands on Session on PythonHands on Session on Python
Hands on Session on Python
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go language
 
Writing Parsers and Compilers with PLY
Writing Parsers and Compilers with PLYWriting Parsers and Compilers with PLY
Writing Parsers and Compilers with PLY
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
OpenGurukul : Language : Python
OpenGurukul : Language : PythonOpenGurukul : Language : Python
OpenGurukul : Language : Python
 
Fscons scalable appplication transfers
Fscons scalable appplication transfersFscons scalable appplication transfers
Fscons scalable appplication transfers
 
A closure ekon16
A closure ekon16A closure ekon16
A closure ekon16
 
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Briefly Rust - Daniele Esposti - Codemotion Rome 2017Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
 

Similar to FTD JVM Internals

Jvm internals
Jvm internalsJvm internals
Jvm internals
Luiz Fernando Teston
 
In Vogue Dynamic
In Vogue DynamicIn Vogue Dynamic
In Vogue Dynamic
Alexander Shopov
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
Charles Nutter
 
Java Basic PART I
Java Basic PART IJava Basic PART I
Java Basic PART I
Soumen Santra
 
Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Anton Arhipov
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topics
Rajesh Verma
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiasanjeeviniindia1186
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaSanjeev Tripathi
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slide
sunny khan
 
How Scala code is expressed in the JVM
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVM
Koichi Sakata
 
Why GC is eating all my CPU?
Why GC is eating all my CPU?Why GC is eating all my CPU?
Why GC is eating all my CPU?
Roman Elizarov
 
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
chen yuki
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
Alexandra Masterson
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
Ganesh Samarthyam
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
Sylvain Wallez
 
Lifting The Veil - Reading Java Bytecode
Lifting The Veil - Reading Java BytecodeLifting The Veil - Reading Java Bytecode
Lifting The Veil - Reading Java Bytecode
Alexander Shopov
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUG
Sylvain Wallez
 

Similar to FTD JVM Internals (20)

Jvm internals
Jvm internalsJvm internals
Jvm internals
 
JAVA BYTE CODE
JAVA BYTE CODEJAVA BYTE CODE
JAVA BYTE CODE
 
In Vogue Dynamic
In Vogue DynamicIn Vogue Dynamic
In Vogue Dynamic
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
Java Basic PART I
Java Basic PART IJava Basic PART I
Java Basic PART I
 
Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topics
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slide
 
How Scala code is expressed in the JVM
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVM
 
Jvm2
Jvm2Jvm2
Jvm2
 
Why GC is eating all my CPU?
Why GC is eating all my CPU?Why GC is eating all my CPU?
Why GC is eating all my CPU?
 
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
2013 syscan360 yuki_chen_syscan360_exploit your java native vulnerabilities o...
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
 
Lifting The Veil - Reading Java Bytecode
Lifting The Veil - Reading Java BytecodeLifting The Veil - Reading Java Bytecode
Lifting The Veil - Reading Java Bytecode
 
A Life of breakpoint
A Life of breakpointA Life of breakpoint
A Life of breakpoint
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUG
 

More from Felipe Mamud

Erlang sem enrolação
Erlang sem enrolaçãoErlang sem enrolação
Erlang sem enrolação
Felipe Mamud
 
Desenvolvendo software no mundo atual
Desenvolvendo software no mundo atualDesenvolvendo software no mundo atual
Desenvolvendo software no mundo atual
Felipe Mamud
 
Reactive programming no mundo Java
Reactive programming no mundo JavaReactive programming no mundo Java
Reactive programming no mundo Java
Felipe Mamud
 
Reactive programming: Brincando com eficiência, composição e assíncronia
Reactive programming: Brincando com eficiência, composição e assíncroniaReactive programming: Brincando com eficiência, composição e assíncronia
Reactive programming: Brincando com eficiência, composição e assíncronia
Felipe Mamud
 
Minha aplicação Java vai pra nuvem. E agora?
Minha aplicação Java vai pra nuvem. E agora?Minha aplicação Java vai pra nuvem. E agora?
Minha aplicação Java vai pra nuvem. E agora?
Felipe Mamud
 
FTD Groovy
FTD GroovyFTD Groovy
FTD Groovy
Felipe Mamud
 
Golang
GolangGolang
Golang
Felipe Mamud
 
Java8
Java8Java8
EBD - Perguntas que não querem calar
EBD - Perguntas que não querem calarEBD - Perguntas que não querem calar
EBD - Perguntas que não querem calar
Felipe Mamud
 
EBD - UFC
EBD - UFCEBD - UFC
EBD - UFC
Felipe Mamud
 
EBD - Escolhas
EBD - EscolhasEBD - Escolhas
EBD - Escolhas
Felipe Mamud
 
EBD - A importância da Escola Bíblica Dominical
EBD - A importância da Escola Bíblica DominicalEBD - A importância da Escola Bíblica Dominical
EBD - A importância da Escola Bíblica Dominical
Felipe Mamud
 
EBD - Força de jovem
EBD - Força de jovemEBD - Força de jovem
EBD - Força de jovem
Felipe Mamud
 
EBD - O que você quer ser
EBD - O que você quer serEBD - O que você quer ser
EBD - O que você quer ser
Felipe Mamud
 
EBD - Deixando de ser bebê
EBD - Deixando de ser bebêEBD - Deixando de ser bebê
EBD - Deixando de ser bebê
Felipe Mamud
 
EBD - O que você faria se fosse invisível
EBD - O que você faria se fosse invisívelEBD - O que você faria se fosse invisível
EBD - O que você faria se fosse invisível
Felipe Mamud
 
EBD - Coisas que não fazem sentido
EBD - Coisas que não fazem sentidoEBD - Coisas que não fazem sentido
EBD - Coisas que não fazem sentido
Felipe Mamud
 
EBD - Faça mais do que saber o que e um bocejo
EBD - Faça mais do que saber o que e um bocejoEBD - Faça mais do que saber o que e um bocejo
EBD - Faça mais do que saber o que e um bocejo
Felipe Mamud
 
EBD - Varias formas de dizer a mesma coisa
EBD - Varias formas de dizer a mesma coisaEBD - Varias formas de dizer a mesma coisa
EBD - Varias formas de dizer a mesma coisa
Felipe Mamud
 
EBD - 10 coisas que temos de dar a Deus
EBD - 10 coisas que temos de dar a DeusEBD - 10 coisas que temos de dar a Deus
EBD - 10 coisas que temos de dar a Deus
Felipe Mamud
 

More from Felipe Mamud (20)

Erlang sem enrolação
Erlang sem enrolaçãoErlang sem enrolação
Erlang sem enrolação
 
Desenvolvendo software no mundo atual
Desenvolvendo software no mundo atualDesenvolvendo software no mundo atual
Desenvolvendo software no mundo atual
 
Reactive programming no mundo Java
Reactive programming no mundo JavaReactive programming no mundo Java
Reactive programming no mundo Java
 
Reactive programming: Brincando com eficiência, composição e assíncronia
Reactive programming: Brincando com eficiência, composição e assíncroniaReactive programming: Brincando com eficiência, composição e assíncronia
Reactive programming: Brincando com eficiência, composição e assíncronia
 
Minha aplicação Java vai pra nuvem. E agora?
Minha aplicação Java vai pra nuvem. E agora?Minha aplicação Java vai pra nuvem. E agora?
Minha aplicação Java vai pra nuvem. E agora?
 
FTD Groovy
FTD GroovyFTD Groovy
FTD Groovy
 
Golang
GolangGolang
Golang
 
Java8
Java8Java8
Java8
 
EBD - Perguntas que não querem calar
EBD - Perguntas que não querem calarEBD - Perguntas que não querem calar
EBD - Perguntas que não querem calar
 
EBD - UFC
EBD - UFCEBD - UFC
EBD - UFC
 
EBD - Escolhas
EBD - EscolhasEBD - Escolhas
EBD - Escolhas
 
EBD - A importância da Escola Bíblica Dominical
EBD - A importância da Escola Bíblica DominicalEBD - A importância da Escola Bíblica Dominical
EBD - A importância da Escola Bíblica Dominical
 
EBD - Força de jovem
EBD - Força de jovemEBD - Força de jovem
EBD - Força de jovem
 
EBD - O que você quer ser
EBD - O que você quer serEBD - O que você quer ser
EBD - O que você quer ser
 
EBD - Deixando de ser bebê
EBD - Deixando de ser bebêEBD - Deixando de ser bebê
EBD - Deixando de ser bebê
 
EBD - O que você faria se fosse invisível
EBD - O que você faria se fosse invisívelEBD - O que você faria se fosse invisível
EBD - O que você faria se fosse invisível
 
EBD - Coisas que não fazem sentido
EBD - Coisas que não fazem sentidoEBD - Coisas que não fazem sentido
EBD - Coisas que não fazem sentido
 
EBD - Faça mais do que saber o que e um bocejo
EBD - Faça mais do que saber o que e um bocejoEBD - Faça mais do que saber o que e um bocejo
EBD - Faça mais do que saber o que e um bocejo
 
EBD - Varias formas de dizer a mesma coisa
EBD - Varias formas de dizer a mesma coisaEBD - Varias formas de dizer a mesma coisa
EBD - Varias formas de dizer a mesma coisa
 
EBD - 10 coisas que temos de dar a Deus
EBD - 10 coisas que temos de dar a DeusEBD - 10 coisas que temos de dar a Deus
EBD - 10 coisas que temos de dar a Deus
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

FTD JVM Internals

  • 2. acknowledgment ● God ● iMasters ● FTD Group
  • 3. who we are? FTD Group http://friendstechday.wordpress.com/about/
  • 5. Java Virtual Machine ● The Java Virtual Machine Specification ● Written in C/C++ ● Stack based VM ● Different implementations ● Symbolic reference ● Garbage Collected ● Java Bytecode ● JIT (Just-In-Time)
  • 6.
  • 8. 1 + 2 = ?
  • 9. (+ 1 2) Lisp? RPN?
  • 10. operand stack PUSH 1 1 1 PUSH 2 2 ADD 3
  • 11. operand stack - bytecode iconst_1 1 1 iconst_2 2 iadd 3
  • 12. Java bytecode is the instruction set of the Java virtual machine opcode = 1 or 2 bytes 256 possible opcodes 198 are currently in use 51 are reserved for future use 3 are set aside as permanently unimplemented list of all opcodes: http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html
  • 13. variable declaration int i; 0: iconst_0 // push 0 to top of the operand stack 1: istore_1 // Pop value from top of operand stack and store as local variable 1
  • 14. object instantiation Object ftd = new Object(); 0: new #2 // Class java/lang/Object 1: dup // duplicate the value on top of the stack 2: invokespecial #3 // Method java/lang/Object “<init>()V”
  • 15. #1, #4, #100? #Wat?
  • 16. Runtime Constant Pool The constant pool contains the following types: ● Integer, Long, Float, Double ● String, Uft8 ● Class ● NameAndType ● Fieldref, Methodref, InterfaceMethodref
  • 17. Java Bytecode Type Description B byte signed byte C char Unicode character D double double-precision floating-point value F float single-precision floating-point value I int integer J long long integer L<classname> reference an instance of class <classname> S short signed short Z boolean true or false [ reference one array dimension
  • 18. Java Code Java Bytecode Expression double d[][][]; [[[D Object mymethod(int I, double d, Thread t) (IDLjava/lang/Thread;)Ljava/lang/Object;
  • 20. Not only Java Stack lives, but also Heap.
  • 22. Code Cache used for compilation and storage of methods that have been compiled to native code by the JIT compiler
  • 23. if >= java1.8 no PermGen yes Metaspace
  • 24. everything is wonderful in Java?.... it depends bro!
  • 25. which the size of a Java String with "Java" content? String java = “Java”;
  • 26. answer: 64 bytes Ahh… how.. WATTT???
  • 27. Java memory consumption 8 bytes Object Header 8 bytes Object reference (x86 may use XX:+UseCompressedOops) 8 bytes alignment (WAT?)
  • 28. data alignment 5 bytes used 3 bytes paddind 8 bytes alignment
  • 29. String explanation Field Type Size (bytes) HEADER 16 value “Java” char[] (16 + 8) + (4 * 2) = 32 offset int 4 count int 4 hash int 4 PADDING = 60 + 4 TOTAL 64 bytes
  • 30. which the size of a java. lang.Boolean? Boolean b = false;
  • 31. answer: 24 bytes Ahh… how.. WATTT???
  • 32. Ok .. But what about classes? OOP?
  • 33. Class File Format ClassFile { u4 magic; u2 minor_version; u2 major_version; u2 constant_pool_count; cp_info contant_pool[constant_pool_count – 1]; u2 access_flags; u2 this_class; u2 super_class; u2 interfaces_count; u2 interfaces[interfaces_count]; u2 fields_count; field_info fields[fields_count]; u2 methods_count; method_info methods[methods_count]; u2 attributes_count; attribute_info attributes[attributes_count]; }
  • 35. And what about the Classloader?
  • 36. JVM initialization order 1. Create a initial class using Bootstrap classloader; 2. links the initial class; 3. initializes it; 4. and invokes the public class method void main(String[])
  • 37. find, check headers class file, super loading, binary created 3 steps, verifying and preparing the type and its direct supers structurally correct, and obeys the semantic requirements allocation of memory foe data structures (optional) checking corrected symbolic references executing initialization method <clinit>
  • 38.
  • 39. Java debug without ide? Is it possible?
  • 40. jdb (included in the JDK 1.2 package)
  • 41. THANK YOU! FTD Group JOIN US! “And be not conformed to this world: but be ye transformed by the renewing of your mind, that ye may prove what {is} that good, and acceptable, and perfect, will of God.” (Romans 12:2)