当前位置:网站首页>JVM understanding
JVM understanding
2022-06-25 18:17:00 【RT_ 0114】
Location ?
On top of the operating system .
Three jvm?
SUN The company's HotSpot- most
BEA The company's JRockit
IBM The company's J9 VM
Where to tune ?-heap
99% Reactor tuning memory . The stack is 100% There will be no rubbish .
Class loader ?
load class file , An object has only one Class,Class It's a template .

1. The loader of the virtual machine
2. Start class loader -rt.jar Internal
3. Extend the classloader -\jre\lib\ext Under the
4. Application Loader -classpath: Under the , Generally, the business written by programmers is loaded here

null: Can't adjust , It's because of the use of C C++ Written
java = C++--,java Just get rid of C Tedious knitting and memory management .
Parent delegate mechanism ? Security
The class loader receives a request to load , Delegate the request to the parent loader to complete , All the way up , Until you start the class loader Boot loader , The startup class cannot be loaded in the reverse direction , Until the load is complete , If the loading is not completed, an error will be reported Class Not Found.
and string Same name and same package , Define this class to execute the error report .
When it comes to execution, look for App-Ext-Boot, In the end in Boot An error is reported due to the execution under , Will give priority to Boot To load the , This will execute java.lang Under the String The method of class cannot be found main Method .
When in Boot I will go again when I can't find it Ext If you can't find it, go again App Look under .

Sandbox security mechanism sandbox? Understanding can
bytecode verifier : Make sure java Class documents comply with java language norm . Not all files go through bytecode validators, such as core classes (java Own classes such as string Because it has been verified ).
Class loader :
Parent delegate mechanism .
Put the code in a protected domain , Determine what the code can do .
native?
Expand java The use of the class , Integrating different programming languages for my use . At first, I wanted to integrate C C++
A special local method stack is opened in memory Native Method Stack, Store local methods
Create a thread, Click in and you'll see start0() Method ,start0() The way is native Method .
By native Decorated methods will call the underlying C, Native Method Stack -> Local interface (JNI)-> Local method library .
Method area ?
Shared by all threads , All information defining the method is saved in this area , It belongs to the shared interval .
Stack ?stack
First in, then out , Last in, first out . bucket .
Each thread creates a stack , When the thread ends, the stack ends , The data in each stack is private .
Stack does not participate in garbage collection , The life cycle is short , Switch through stack frame .
Store the object : local variable + References to objects + Example method . That is, things inside the method and method references .
queue ?FIFO
fifo . The Conduit .
main Method executes first and ends last ?
Pressing stack ,main Go first and start to adjust other business methods .
StackOverflowError Stack overflow ?
Recursive detuning method , Many methods are pushed into the stack .
Pile up -heap?
One jvm only one heap,stack It is thread level and can have multiple .
The heap size can be adjusted .
- The younger generation : Class birth death zone .
- Old age : Transitional area .
- Meta space : The undead . memory-resident . Logically there is , There is no Physics .
Heap memory tuning :-Xms1024m -Xmx1024m -XX:+PrintGCDetails
Pile up 、 Stack 、 Method area comparison ?
Pile up :
Provide all class instances and array object storage areas .
jvm There's only one heap area (heap) Shared by all threads , Basic types and object references are not stored in the heap , Just store the object itself .
The stack area :
Each thread contains a stack area , The stack only stores references to objects of basic data type and custom objects ( Not object ), Objects are stored in the heap .
The data in each stack ( Original type and object reference ) It's all private , Other stacks cannot be accessed .
Method area :
It's also called static area , It's like a pile , Shared by all threads . The method area contains all the class and static Variable .
The method area contains elements that are always unique throughout the program , Such as class,static Variable .
The runtime constant pools are allocated in Java In the method area of virtual machine .
边栏推荐
- 【深入理解TcaplusDB技术】如何实现Tmonitor单机安装
- [in depth understanding of tcapulusdb technology] tcapulusdb business data backup
- Handling method of qstring containing "\u0000" in QT
- 移动端异构运算技术 - GPU OpenCL 编程(基础篇)
- 微信小程序报错:request:fail url not in domain list
- 【深入理解TcaplusDB技术】单据受理之创建游戏区
- Garbage collector and memory allocation strategy
- Install spark + run Scala related projects with commands + crontab scheduled execution
- What is an operator?
- Redis command string
猜你喜欢

IVX 启航

158_模型_Power BI 使用 DAX + SVG 打通制作商业图表几乎所有可能

One article solves all search backtracking problems of Jianzhi offer

Uncover ges super large scale graph computing engine hyg: Graph Segmentation

SDN system method | 9 Access network

解决nvprof 报错ERR_NVGPUCTRPERM - The user does not have permission to profile on the target device.

General message publishing and subscription in observer mode

Hash of redis command

【深入理解TcaplusDB技术】一键安装Tmonitor后台

深度学习网路模型
随机推荐
[compréhension approfondie de la technologie tcaplusdb] sauvegarde des données d'affaires tcaplusdb
Redis trend - NVM memory
股票开户怎么办理?证券开户哪家好 办理开户安全吗
Lazy singleton mode from shallow to deep
Which is better and safer, GF easy gold rush or compass
跨境电商亚马逊、eBay、Shopee、Lazada、速卖通、沃尔玛、阿里国际等平台,怎样进行自养号测评更安全?
视觉SLAM十四讲 第9讲 卡尔曼滤波
ASP. Net supermarket convenience store online shopping mall source code, for the surrounding distribution system
What is the ranking of the top ten securities companies? Is it safe to open a mobile account?
沁恒CH583 USB 自定义HID调试记录
微服务介绍
【深入理解TcaplusDB技術】TcaplusDB業務數據備份
华为云SRE确定性运维专刊(第一期)
Android物联网应用程序开发(智慧园区)—— 图片预览界面
el-table高度自适应
RMAN备份数据库_重启RMAN备份
One article solves all search backtracking problems of Jianzhi offer
Redis command string
Deep understanding of ELF files
Virtual machine class loading mechanism