마인드 맵 갤러리 JVM related knowledge points
This is a mind map about JVM related knowledge points. JVM (Java Virtual Machine, Java Virtual Machine) is the core and foundation of Java technology. As a specification for computing devices, JVM is a fictitious computer that operates by simulating various computer functions on an actual computer platform (operating system).
2024-11-03 10:22:58에 편집됨Rumi: 10 dimensiones del despertar espiritual. Cuando dejes de buscarte, encontrarás todo el universo porque lo que estás buscando también te está buscando. Cualquier cosa que haga perseverar todos los días puede abrir una puerta a las profundidades de su espíritu. En silencio, me metí en el reino secreto, y disfruté todo para observar la magia que me rodea y no hice ningún ruido. ¿Por qué te gusta gatear cuando naces con alas? El alma tiene sus propios oídos y puede escuchar cosas que la mente no puede entender. Busque hacia adentro para la respuesta a todo, todo en el universo está en ti. Los amantes no terminan reuniéndose en algún lugar, y no hay separación en este mundo. Una herida es donde la luz entra en tu corazón.
¡La insuficiencia cardíaca crónica no es solo un problema de la velocidad de la frecuencia cardíaca! Es causado por la disminución de la contracción miocárdica y la función diastólica, lo que conduce al gasto cardíaco insuficiente, lo que a su vez causa congestión en la circulación pulmonar y la congestión en la circulación sistémica. Desde causas, inducción a mecanismos de compensación, los procesos fisiopatológicos de insuficiencia cardíaca son complejos y diversos. Al controlar el edema, reducir el frente y la poscarga del corazón, mejorar la función de comodidad cardíaca y prevenir y tratar causas básicas, podemos responder efectivamente a este desafío. Solo al comprender los mecanismos y las manifestaciones clínicas de la insuficiencia cardíaca y el dominio de las estrategias de prevención y tratamiento podemos proteger mejor la salud del corazón.
La lesión por isquemia-reperfusión es un fenómeno que la función celular y los trastornos metabólicos y el daño estructural empeorarán después de que los órganos o tejidos restauren el suministro de sangre. Sus principales mecanismos incluyen una mayor generación de radicales libres, sobrecarga de calcio y el papel de los leucocitos microvasculares y. El corazón y el cerebro son órganos dañados comunes, manifestados como cambios en el metabolismo del miocardio y los cambios ultraestructurales, disminución de la función cardíaca, etc. Las medidas de prevención y control incluyen eliminar los radicales libres, reducir la sobrecarga de calcio, mejorar el metabolismo y controlar las condiciones de reperfusión, como baja sodio, baja temperatura, baja presión, etc. Comprender estos mecanismos puede ayudar a desarrollar opciones de tratamiento efectivas y aliviar las lesiones isquémicas.
Rumi: 10 dimensiones del despertar espiritual. Cuando dejes de buscarte, encontrarás todo el universo porque lo que estás buscando también te está buscando. Cualquier cosa que haga perseverar todos los días puede abrir una puerta a las profundidades de su espíritu. En silencio, me metí en el reino secreto, y disfruté todo para observar la magia que me rodea y no hice ningún ruido. ¿Por qué te gusta gatear cuando naces con alas? El alma tiene sus propios oídos y puede escuchar cosas que la mente no puede entender. Busque hacia adentro para la respuesta a todo, todo en el universo está en ti. Los amantes no terminan reuniéndose en algún lugar, y no hay separación en este mundo. Una herida es donde la luz entra en tu corazón.
¡La insuficiencia cardíaca crónica no es solo un problema de la velocidad de la frecuencia cardíaca! Es causado por la disminución de la contracción miocárdica y la función diastólica, lo que conduce al gasto cardíaco insuficiente, lo que a su vez causa congestión en la circulación pulmonar y la congestión en la circulación sistémica. Desde causas, inducción a mecanismos de compensación, los procesos fisiopatológicos de insuficiencia cardíaca son complejos y diversos. Al controlar el edema, reducir el frente y la poscarga del corazón, mejorar la función de comodidad cardíaca y prevenir y tratar causas básicas, podemos responder efectivamente a este desafío. Solo al comprender los mecanismos y las manifestaciones clínicas de la insuficiencia cardíaca y el dominio de las estrategias de prevención y tratamiento podemos proteger mejor la salud del corazón.
La lesión por isquemia-reperfusión es un fenómeno que la función celular y los trastornos metabólicos y el daño estructural empeorarán después de que los órganos o tejidos restauren el suministro de sangre. Sus principales mecanismos incluyen una mayor generación de radicales libres, sobrecarga de calcio y el papel de los leucocitos microvasculares y. El corazón y el cerebro son órganos dañados comunes, manifestados como cambios en el metabolismo del miocardio y los cambios ultraestructurales, disminución de la función cardíaca, etc. Las medidas de prevención y control incluyen eliminar los radicales libres, reducir la sobrecarga de calcio, mejorar el metabolismo y controlar las condiciones de reperfusión, como baja sodio, baja temperatura, baja presión, etc. Comprender estos mecanismos puede ayudar a desarrollar opciones de tratamiento efectivas y aliviar las lesiones isquémicas.
JVM related knowledge points
JVM core knowledge points
Java virtual machine structure
Java heap
Classic generational design
new generation
eden district
survival area
from
to
By default eden:survial:to = 8:1:1
old age
permanent generation
Generation-agnostic design
Java virtual machine stack
Used to store information such as local variable tables, operand stacks, dynamic connections, method exits, etc.
native method stack
The local method stack serves the native (Native) methods used by the virtual machine.
Method area ("Non-Heap")
Used to store type information, constants, static variables, and files compiled by the just-in-time compiler that have been loaded by the virtual machine. Code cache and other data.
Runtime constant pool
In addition to the description information such as the version, fields, methods, and interfaces of the class, there is also a constant pool table (Constant Pool Table), which is used to store various literals and symbol references generated during compilation. This part of the content will be in the class After loading, it is stored in the runtime constant pool in the method area.
program counter PC
direct memory
Related to NIO, the default value is the same as the value of the -Xmx parameter
Garbage collection
Garbage collection concept
Garbage collection algorithm
mark clear
mark copy
Tag sorting
Collection by generation
safe spot
safe area
memory set
memory set accuracy
word length precision
Object precision
card accuracy
Card table
Card table maintenance
memory barrier
garbage collector
Classic garbage collector
Serial (new generation)
Serial Old (old generation)
General working process
Parallel Scavenge (New Generation)
Parallel Old
ParNew (new generation)
CMS
G1
G1 working process
The relationship between group and use
Low latency garbage collector
Shenandoah
Shenandoah's workflow
ZGC
dyed pointer
ZGC workflow
Object tracking
type of reference
strong reference
Soft reference SoftReference<T>
Weak reference WeakReference<T>
Can be used as an internal cache for Java
Phantom reference PhantomReference<T>
Can be used for tracking of escaped objects
concurrent reachability
three color marking method
Object disappearing problem when processing parallel marking
incremental update
original snapshot
Object escape
Memory allocation & GC rules
allocated on stack
TLAB (Eden area, TLAB memory is allocated through CAS)
allocated on heap
Large objects enter the old generation directly
Long-lived objects will enter the old generation
Dynamic object age determination
Space allocation guarantee
class loading
Class loading process
load
verify
File format verification
Metadata validation
Bytecode verification
Symbol reference verification
Prepare
parse
Class or interface resolution
Field parsing
Method analysis
Interface method analysis
initialization
use
uninstall
class loader
Common class loaders
Boot class/startup class loader
extension class loader
Application class/system class loader
Custom class loader
Parental delegation
Breaking Parental Delegation
OSGI hot deployment
Tomact
Hot replacement is achieved by breaking parental delegation
JVM online troubleshooting
Performance monitoring
JDK comes with tools
jps view Java process
jps -l -v
jstat View virtual machine runtime information
jstat -gc PID
jstat-gcutil
jmap export to heap file
jmap -histo PID > ../s.txt generates object statistics for Java programs
jmap -dump:format=b,file=../heap.hprof Get the current heap snapshot of the Java program
jhat heap analysis
jhat ../heap.hprof analyzes files exported by jmap
Visit http://127.0.0.1:7000 in the browser to view the analysis results.
jstack View thread stack
jstack -l PID View information about all locks in the program
jstatd remote host information collection
jstatd -J -Djava.security.policy=../jstatd.all.policy
Client command form
jps IP:port
jstat -gcutil PID@IP:port
Graphical monitoring tools
jconsole
visualVM
Memory analysis tools
MAT
Third party tools
Arthas
java -jar arthas-boot.jar starts arthas
The dashboard can view the running status of the entire process, including threads, memory, GC, and operating environment information.
thread View thread details
thread threadId View the thread stack, then we directly locate the code that causes high CPU usage
thread -b to view thread deadlocks
trace Which of the tracing sub-methods is slower?
trace xxx.xxx.<pacegename>.<classname> <functionname>
monitor monitoring method call times
monitor -c 5 org.apache.dubbo.demo.provider.DemoServiceImpl sayHello
profiler opens the web monitoring view
Profiler Start
profiler getSamples
profiler status
profiler stop --format flamegraph generate flame graph
By default, arthas uses port 3658, you can open: http://localhost:3658/arthas-output/ to view the profiler results under the arthas-output directory:
profiler dump
memory overflow
Heap memory overflow
Error performance
The error message states "java heap space"
Solution
Use the -Xmx parameter to specify a larger heap space
Use tools such as MAT or Visual VM to find objects that occupy a large amount of heap space and make reasonable optimizations in the application
direct memory overflow
Error performance
Throw OOM directly, prompting nio's DirectByteBuffer allocation exception
Cause analysis
The system spatial space of 32 -bit operating system process is 2GB, and the user space is 2GB. When the sum of the memory of all the processes of Java is greater than 2GB, it will appear.
nio's stream object is not closed, or the pipe is not closed
solution
Display settings -XX:MaxDirectMemorySize parameter, set the maximum direct memory space
Too many threads
Error performance
"unable to create new native thread"
solution
Reduce heap space -Xmx
Reduce the memory space occupied by each thread -Xss
Note that the thread stack size cannot be set too small, otherwise stack overflow will occur.
permanent area overflow
solution
Increase the value of MaxPermSize.
Reduce the number of classes required by the system.
Use ClassLoader to load each class reasonably and recycle it regularly.
GC is inefficient