SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
JVM
A quick view about Java Virtual Machine
Once upon a time...
Java as lang and Platform
Java is also a Programming Language and a Platform. We’ll speak about Java
as Platform in this presentation.
As Language, Java is pretty nice despite of verbosity.
Why use a VM?
Once a program is created, it must be compiled
for each OS. If you want your program for Mac,
compile for Mac. Windows? Same. Linux?
Same…
Furthermore, memory allocation needed be done
manually.
Using JVM, all responsability to handle memory
or run in many OSs is delegated to it.
The JVM abstracts not only the hardware layer
but also the communication with the Operating
System.
How does it work?
Hello.java Hello.class
Javac
JRE
JRE
Java Bytecode
Compiled from "Hello.java"
class HelloJava {
HelloJava();
public static void
main(java.lang.String[]);
}
class HelloJava {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Kotlin Bytecode
Compiled from "Hello.kt"
public final class Hello {
public Hello();
}
class Hello
fun main(args: Array<String>) {
println("Hello World!")
}
Heap
Heap
The JVM has a heap, a runtime data
area from which memory for all
class instances and arrays are
allocated. Is shared by all Threads.
It is where the Objects born, grow
and die. Example:
$ java -Xms128m -Xmx512m -jar
homeboy-1.0-SNAPSHOT.jar
To set the maximum Java heap size
we use the option -Xmx.
to set the initial Java heap size
-Xms.
Heap
Eden Survivor Old
PermGen
PermGen
The JVM also allocate objects apart the heap, at
Permgen.
This area stores class related data from class
definitions, structures, methods, field, and
constants.
PermGen
Despite standing in his name, the memory space
from PermGen is also collected in a FullGC.
IT can cause java.lang.OutOfMemoryError:
PermGen space if it runs out if space. This
happens normally when the exaggerated
amount of classes that are loaded into memory.
“PermGen is Dead. Long live PermGen”
-JDK 8 HotSpot JVM
Metaspace
Metaspace is a new memory space - since java
8 - replacing Permgen.
What makes it different of Permgen?
Instead of allocate memory inside JVM, it
allocates in the OS memory.
Garbage Collector
Garbage Collector - a quick view on Heap (again)
Eden Survivor Old
Heap
Garbage collector - Mark and sweep
On the first cycle, this algorithm marks all accessible objects in all
current threads.
On the second cycle Sweeps all objects which were not marked in
the last cycle.
The Mark and Sweep is outdated, but it was a great learning to deal
with non-referenced objects.
Garbage collector - generational copying
● The idea of this algorithm is to divide objects into generations, young and old generation.
● The new generation is usually smaller than the old one (1/3 of the old).
● The GC scans the younger generation, which does not paralyze the JVM.
● Who "survives" is copied to the Old generation and the space of the Young Generation is
made available again.
● The discard does not remove from the memory yet, it just marks the memory as
available.
● Although it is costly to copy an object to the old generation to another part of the Heap,
few survive, so the cost is low.
● Also, copying fewer objects is still "cheaper" than removing objects.
● When Young is crowded, a minor collect runs. At this point objects are sent to the old
generation.
Garbage collector - generational copying
● Depending on the JVM, large objects have the behavior of already being copied to the Old
generation;
● Generational copying copies the objects to the next in a clustered fashion, optimizing
memory and ensuring that there is no memory fragmentation.
● It is possible to increase the proportion of the space allocated to Young Generation by
the option -XX: NewRatio = 1 (50%). By default, 2/3 will be old and 1/3 will be young; by
changing the value to 1, we will have 1/2 for each area.
Garbage collector - Garbage First (G1)
Although it is considered a generational
algorithm, it does not separates the heap in
two generations, but in many small regions.
Dynamically, the G1 chooses some regions
to be collected (which gives the logical
sense of those regions to be a young gen).
JIT Compiler
JIT Compiler (Just in time) or slow is your granny
JIT compiles Java code in Runtime to improve the application
performance.
But I said before that JVM read Bytecode and runs it in a VM,
right?
The first JVMs were the same, but with each version, the JVM is
increased and brought this new feature to the VM.
JIT Compiler (Just in time)
JIT has the ability to do optimization according to the use of the
program and the current conditions. The so-called hotspots.
What JIT does behind the scene?
It compiles for native platform and runs native code optimizing
the application running.
Thanks =)
By João Santana
joaosantana.ti@gmail.com
github.com/jonss

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (7)

Java JVM
Java JVMJava JVM
Java JVM
 
Memory leak
Memory leakMemory leak
Memory leak
 
Java Virtual Machine
Java Virtual Machine Java Virtual Machine
Java Virtual Machine
 
jLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoTjLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoT
 
Java 2
Java 2Java 2
Java 2
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platform
 
Inside the JVM
Inside the JVMInside the JVM
Inside the JVM
 

Ähnlich wie JVM overview: memory, bytecode, GC & JIT

The JVM is your friend
The JVM is your friendThe JVM is your friend
The JVM is your friendKai Koenig
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machineNikhil Sharma
 
Garbage collection
Garbage collectionGarbage collection
Garbage collectionMudit Gupta
 
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben EvansJava Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben EvansJAX London
 
Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)Marcos García
 
Jvm performance tuning
Jvm performance tuningJvm performance tuning
Jvm performance tuningIgor Igoroshka
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Sandeep Rawat
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsIsuru Perera
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
 
JVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crashJVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crashAtharva Bhingarkar
 
JVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crashJVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crashAjit Bhingarkar
 
OOPs, OOMs, oh my! Containerizing JVM apps
OOPs, OOMs, oh my! Containerizing JVM appsOOPs, OOMs, oh my! Containerizing JVM apps
OOPs, OOMs, oh my! Containerizing JVM appsSematext Group, Inc.
 
Java Performance and Using Java Flight Recorder
Java Performance and Using Java Flight RecorderJava Performance and Using Java Flight Recorder
Java Performance and Using Java Flight RecorderIsuru Perera
 
Profiler Guided Java Performance Tuning
Profiler Guided Java Performance TuningProfiler Guided Java Performance Tuning
Profiler Guided Java Performance Tuningosa_ora
 
It's always sunny with OpenJ9
It's always sunny with OpenJ9It's always sunny with OpenJ9
It's always sunny with OpenJ9DanHeidinga
 

Ähnlich wie JVM overview: memory, bytecode, GC & JIT (20)

The JVM is your friend
The JVM is your friendThe JVM is your friend
The JVM is your friend
 
Jvm is-your-friend
Jvm is-your-friendJvm is-your-friend
Jvm is-your-friend
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Java lab lecture 1
Java  lab  lecture 1Java  lab  lecture 1
Java lab lecture 1
 
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben EvansJava Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
 
Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)
 
JVM Magic
JVM MagicJVM Magic
JVM Magic
 
Jvm performance tuning
Jvm performance tuningJvm performance tuning
Jvm performance tuning
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Jvm internal detail
Jvm internal detailJvm internal detail
Jvm internal detail
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and Flamegraphs
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
JVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crashJVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crash
 
JVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crashJVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crash
 
OOPs, OOMs, oh my! Containerizing JVM apps
OOPs, OOMs, oh my! Containerizing JVM appsOOPs, OOMs, oh my! Containerizing JVM apps
OOPs, OOMs, oh my! Containerizing JVM apps
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Java Performance and Using Java Flight Recorder
Java Performance and Using Java Flight RecorderJava Performance and Using Java Flight Recorder
Java Performance and Using Java Flight Recorder
 
Profiler Guided Java Performance Tuning
Profiler Guided Java Performance TuningProfiler Guided Java Performance Tuning
Profiler Guided Java Performance Tuning
 
It's always sunny with OpenJ9
It's always sunny with OpenJ9It's always sunny with OpenJ9
It's always sunny with OpenJ9
 

Kürzlich hochgeladen

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Kürzlich hochgeladen (20)

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

JVM overview: memory, bytecode, GC & JIT

  • 1. JVM A quick view about Java Virtual Machine
  • 2. Once upon a time...
  • 3. Java as lang and Platform Java is also a Programming Language and a Platform. We’ll speak about Java as Platform in this presentation. As Language, Java is pretty nice despite of verbosity.
  • 4. Why use a VM? Once a program is created, it must be compiled for each OS. If you want your program for Mac, compile for Mac. Windows? Same. Linux? Same… Furthermore, memory allocation needed be done manually. Using JVM, all responsability to handle memory or run in many OSs is delegated to it. The JVM abstracts not only the hardware layer but also the communication with the Operating System.
  • 5. How does it work? Hello.java Hello.class Javac JRE JRE
  • 6. Java Bytecode Compiled from "Hello.java" class HelloJava { HelloJava(); public static void main(java.lang.String[]); } class HelloJava { public static void main(String[] args) { System.out.println("Hello World!"); } }
  • 7. Kotlin Bytecode Compiled from "Hello.kt" public final class Hello { public Hello(); } class Hello fun main(args: Array<String>) { println("Hello World!") }
  • 9. Heap The JVM has a heap, a runtime data area from which memory for all class instances and arrays are allocated. Is shared by all Threads. It is where the Objects born, grow and die. Example: $ java -Xms128m -Xmx512m -jar homeboy-1.0-SNAPSHOT.jar To set the maximum Java heap size we use the option -Xmx. to set the initial Java heap size -Xms.
  • 12. PermGen The JVM also allocate objects apart the heap, at Permgen. This area stores class related data from class definitions, structures, methods, field, and constants.
  • 13. PermGen Despite standing in his name, the memory space from PermGen is also collected in a FullGC. IT can cause java.lang.OutOfMemoryError: PermGen space if it runs out if space. This happens normally when the exaggerated amount of classes that are loaded into memory.
  • 14. “PermGen is Dead. Long live PermGen” -JDK 8 HotSpot JVM
  • 15. Metaspace Metaspace is a new memory space - since java 8 - replacing Permgen. What makes it different of Permgen? Instead of allocate memory inside JVM, it allocates in the OS memory.
  • 17. Garbage Collector - a quick view on Heap (again) Eden Survivor Old Heap
  • 18. Garbage collector - Mark and sweep On the first cycle, this algorithm marks all accessible objects in all current threads. On the second cycle Sweeps all objects which were not marked in the last cycle. The Mark and Sweep is outdated, but it was a great learning to deal with non-referenced objects.
  • 19. Garbage collector - generational copying ● The idea of this algorithm is to divide objects into generations, young and old generation. ● The new generation is usually smaller than the old one (1/3 of the old). ● The GC scans the younger generation, which does not paralyze the JVM. ● Who "survives" is copied to the Old generation and the space of the Young Generation is made available again. ● The discard does not remove from the memory yet, it just marks the memory as available. ● Although it is costly to copy an object to the old generation to another part of the Heap, few survive, so the cost is low. ● Also, copying fewer objects is still "cheaper" than removing objects. ● When Young is crowded, a minor collect runs. At this point objects are sent to the old generation.
  • 20. Garbage collector - generational copying ● Depending on the JVM, large objects have the behavior of already being copied to the Old generation; ● Generational copying copies the objects to the next in a clustered fashion, optimizing memory and ensuring that there is no memory fragmentation. ● It is possible to increase the proportion of the space allocated to Young Generation by the option -XX: NewRatio = 1 (50%). By default, 2/3 will be old and 1/3 will be young; by changing the value to 1, we will have 1/2 for each area.
  • 21. Garbage collector - Garbage First (G1) Although it is considered a generational algorithm, it does not separates the heap in two generations, but in many small regions. Dynamically, the G1 chooses some regions to be collected (which gives the logical sense of those regions to be a young gen).
  • 23. JIT Compiler (Just in time) or slow is your granny JIT compiles Java code in Runtime to improve the application performance. But I said before that JVM read Bytecode and runs it in a VM, right? The first JVMs were the same, but with each version, the JVM is increased and brought this new feature to the VM.
  • 24. JIT Compiler (Just in time) JIT has the ability to do optimization according to the use of the program and the current conditions. The so-called hotspots. What JIT does behind the scene? It compiles for native platform and runs native code optimizing the application running.
  • 25. Thanks =) By João Santana joaosantana.ti@gmail.com github.com/jonss