Sua aplicação deu crash ? Consumindo muita memória ? Lentidão ? Vamos falar sobre como a JVM funciona, como coletar métricas e realizar o tuning na performance de aplicações utilizando as ferramentas nativas da JVM. Além de detecção e correção de problemas como memory leaks ou freezing causado pelo Garbage Collector
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
Inside the JVM - Performance & Garbage Collector Tuning in JAVA
1. Globalcode – Open4education
Inside the JVM - Performance &
Garbage Collector Tuning in JAVA
Rafael Monteiro e Pereira
Data Scientist – DataLabs Serasa Experian
5. Globalcode – Open4education
Java Mission Control
The server VM needs to be started with following
options
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder
6. Globalcode – Open4education
JMC->JMX Console
Captures and presents live data about:
Garbage Collection (GC) Pauses
Memory (Heap Usage)
CPU Usage
Other attributes exposes via Mbeans
7. Globalcode – Open4education
JMC->Flight Recorder
A profiling and event collection framework built into
the Oracle JDK
Gather low level information about the JVM and
application are behaving without performance
impact (less than 2%)
9. Globalcode – Open4education
Thread Communication
Just Create a Queue
right ?
You are sure that you
wanna block ?
https://github.com/real-
logic/benchmarks
LinkedBlockingQueue 154
μs
ArrayBlockingQueue 56 μs
ConcurrentLinkedQueue 44 μs
Disruptor 3.0 20 μs
10. Globalcode – Open4education
Thread Communication
Disruptor (
https://github.com/LMAX-Exchange/disruptor
)
Very fast Inter-Thread
Message Library
Source: https://martinfowler.com/articles/images/lmax/arch-full.png
13. Globalcode – Open4education
Performance Test
JMH
Building, running, and analysing
nano/micro/milli/macro benchmarks written in Java
and other languages targetting the JVM.
30. Globalcode – Open4education
GC - Tips
Use a LIB !
Open HFT -> https://github.com/OpenHFT
https://github.com/OpenHFT/Java-Thread-Affinity
https://github.com/OpenHFT/Chronicle-Queue
https://github.com/OpenHFT/Chronicle-Logger
Some Tips
Be careful with big Heap sizes. Usually is not a good idea to go beyond 8
GB on Hotspot.
Big Heap == Slow GC !!! Consider using off-heap allocation if a lot of
information must be maintained in memory.