当前位置:网站首页>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 .
边栏推荐
- 延时函数如何延时
- 篇5:VS2017搭建QT5.9.9开发环境
- 【深入理解TcaplusDB技术】Tmonitor后台一键安装
- 【深入理解TcaplusDB技术】单据受理之建表审批
- Solve nvprof error err_ NVGPUCTRPERM - The user does not have permission to profile on the target device.
- The Stackies 2022:32个营销技术栈入选
- RMAN备份数据库_双重备份备份集(Duplexing Backup Sets)
- 【深入理解TcaplusDB技术】单据受理之创建游戏区
- IET出席2022世界科技社团发展与治理论坛 为构建国际科技共同体献言献策
- 【路径规划】如何给路径增加运动对象
猜你喜欢

Mobile heterogeneous computing technology - GPU OpenCL programming (basic)

怎么判断自己是否适合转行软件测试

anaconda下载清华源

Kotlin of Android cultivation manual - several ways to write a custom view

SDN system method | 9 Access network

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

Garbage collector and memory allocation strategy
Qinheng ch583 USB custom hid debugging record

篇5:VS2017搭建QT5.9.9开发环境

SDN系统方法 | 10. SDN的未来
随机推荐
158_ Model_ Power Bi uses DAX + SVG to open up almost all possibilities for making business charts
New characteristics of cultural consumption in the era of digital economy
Article 6:clion:toolchains are not configured configure disable profile
Matlab中图形对象属性gca使用
将Graph Explorer搬上JupyterLab:使用GES4Jupyter连接GES并进行图探索
RMAN备份数据库_双重备份备份集(Duplexing Backup Sets)
Deep learning network model
Deep understanding of ELF files
延时函数如何延时
广发易淘金和指南针哪个更好,更安全一些
The Stackies 2022:32个营销技术栈入选
【 NLP 】 in this year's English college entrance examination, CMU delivered 134 high scores with reconstruction pre training, significantly surpassing gpt3
微服务介绍
OSError: Unable to open file (truncated file: eof = 254803968, sblock->base_addr = 0, stored_eof = 2
力扣每日一题-第27天-561.数组拆分Ⅰ
近来开发的一款简单易用的图可视化工具
Recursion and divide and conquer
Network security algorithm
Interrupt operation: abortcontroller learning notes
解析数仓lazyagg查询重写优化