SlideShare una empresa de Scribd logo
1 de 41
Descargar para leer sin conexión
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)

Más contenido relacionado

La actualidad más candente

Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeDmitri Nesteruk
 
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 / OverviewMarkus 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 goDvir 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 PythonYung-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 2020Yung-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 PythonSumit Raj
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go languageTzar Umang
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingPositive Hack Days
 
OpenGurukul : Language : Python
OpenGurukul : Language : PythonOpenGurukul : Language : Python
OpenGurukul : Language : PythonOpen Gurukul
 
Fscons scalable appplication transfers
Fscons scalable appplication transfersFscons scalable appplication transfers
Fscons scalable appplication transfersDaniel Stenberg
 
A closure ekon16
A closure ekon16A closure ekon16
A closure ekon16Max 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 2017Codemotion
 

La actualidad más candente (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 a FTD JVM Internals

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 JavaCharles Nutter
 
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_topicsRajesh Verma
 
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 basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiasanjeeviniindia1186
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slidesunny 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 JVMKoichi 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 SlidesAlexandra Masterson
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh 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 BytecodeAlexander 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 JUGSylvain Wallez
 

Similar a 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
 

Más de Felipe Mamud

Erlang sem enrolação
Erlang sem enrolaçãoErlang sem enrolação
Erlang sem enrolaçãoFelipe Mamud
 
Desenvolvendo software no mundo atual
Desenvolvendo software no mundo atualDesenvolvendo software no mundo atual
Desenvolvendo software no mundo atualFelipe Mamud
 
Reactive programming no mundo Java
Reactive programming no mundo JavaReactive programming no mundo Java
Reactive programming no mundo JavaFelipe 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íncroniaFelipe 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
 
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 calarFelipe 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 DominicalFelipe Mamud
 
EBD - Força de jovem
EBD - Força de jovemEBD - Força de jovem
EBD - Força de jovemFelipe Mamud
 
EBD - O que você quer ser
EBD - O que você quer serEBD - O que você quer ser
EBD - O que você quer serFelipe 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ívelFelipe 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 sentidoFelipe 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 bocejoFelipe 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 coisaFelipe 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 DeusFelipe Mamud
 

Más de 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
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Último (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

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)