当前位置:网站首页>What is JVM? What are the purposes of JVM tuning?
What is JVM? What are the purposes of JVM tuning?
2022-07-07 04:39:00 【Blue92120】
jvm The composition of
jvm Is one that can run java The virtual machine of bytecode . Loading subsystems by classes 、 Run time data area ( Memory model ) And bytecode execution engine , Cross platform , Shield the differences between the underlying hardware and instructions of different operating systems from the software level , Write in one place and run in multiple places. Pass before running javac The command will be converted to a bytecode file , When bytecode file is running JVM So I started to work .
1. Class loading subsystem
2. Run time data area :
Pile up : new The objects that come out are put in the heap , It is divided into old age and young generation , The elderly account for the whole pile 2/3, Younger generation 1/3. The young generation is divided into three parts : Eden Park ,survivor District (s0 and s1), The proportion 8:1:1 . When the objects in Eden Park are full , Bytecode engine will execute a garbage collection thread (minor( Pretty ) gc) Copy non garbage objects to survivor District , Then delete the garbage object
Stack : As long as one thread is running ,Java The virtual machine will allocate a little memory space to this thread , This space is called thread stack ( Used to put its own local variables inside the method ) A method corresponds to a stack frame memory area
Program counter : Each program will be assigned a program counter when it runs , Record the memory address of the code to be executed immediately , The function is that the current thread is robbed of the execution right , When resuming execution, continue to run from the recorded memory address
Method area : Store constants , Static variables , Class information ( After the bytecode file is loaded, it is placed in the method area )
Native Method Stack : The memory space allocated when executing local methods is provided by the local method stack , The underlying use C C++ The method of language writing is the local method
3. Bytecode execution engine
jvm tuning
Tuning purpose : The user process will be stopped when garbage is collected (STW) stop the word , Concentrate on garbage collection , Reduce GC(minor full)
Why would there be SWT: When the program is running , There's garbage ,full GC Start looking for garbage , Start with local variables and find all objects , Are marked as non garbage objects , Then looking for other variables . If there is a thread ,GC The thread is not finished yet , It's over first , Then the stack memory space in it will be released , Releasing it means that the local variable table is gone , Local variables are also destroyed , That just GC When looking for garbage, clearly mark these objects as not garbage objects , Now it's garbage again , This is not appropriate . So when recycling garbage , Let the user thread stop first , Don't affect the state of the object , Mark it and then clean up the garbage , Maybe the performance is a little higher
Can it be right? JVM tuning , Make it almost impossible Full GC :
Tuning Tools : Arthas( Alsace ) It is open source by Alibaba java Diagnostic tools , Support JDK6+, Use command line interaction mode . Easy to use , Monitor progress .
边栏推荐
- 食堂用户菜品关系系统(C语言课设)
- 一图看懂!为什么学校教了你Coding但还是不会的原因...
- Detect when a tab bar item is pressed
- 过气光刻机也不能卖给中国!美国无理施压荷兰ASML,国产芯片再遭打压
- 【ArcGIS教程】专题图制作-人口密度分布图——人口密度分析
- [untitled]
- SQL where multiple field filtering
- C#使用西门子S7 协议读写PLC DB块
- Station B boss used my world to create convolutional neural network, Lecun forwarding! Burst the liver for 6 months, playing more than one million
- Network Security Learning - Information Collection
猜你喜欢
[OA] excel document generator: openpyxl module
Surpassing postman, the new generation of domestic debugging tool apifox is elegant enough to use
Kivy tutorial of setting the size and background of the form (tutorial includes source code)
This "advanced" technology design 15 years ago makes CPU shine in AI reasoning
AI 落地新题型 RPA + AI =?
What if win11 pictures cannot be opened? Repair method of win11 unable to open pictures
[knife-4j quickly build swagger]
EasyCVR视频广场点击播放时,主菜单高亮效果消失问题的修复
Lessons and thoughts of the first SQL injection
See Gardenia minor
随机推荐
Mathematical analysis_ Notes_ Chapter 10: integral with parameters
过气光刻机也不能卖给中国!美国无理施压荷兰ASML,国产芯片再遭打压
【实践出真理】import和require的引入方式真的和网上说的一样吗
You can't sell the used lithography machine to China! The United States unreasonably pressured the Dutch ASML, and domestic chips were suppressed again
论文上岸攻略 | 如何快速入门学术论文写作
Unit test asp Net MVC 4 Application - unit testing asp Net MVC 4 apps thoroughly
Win11图片打不开怎么办?Win11无法打开图片的修复方法
AI landing new question type RPA + AI =?
Highly paid programmers & interview questions. Are you familiar with the redis cluster principle of series 120? How to ensure the high availability of redis (Part 1)?
On the 110th anniversary of Turing's birth, has the prediction of intelligent machine come true?
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
Common methods of list and map
EasyCVR视频广场点击播放时,主菜单高亮效果消失问题的修复
True global ventures' newly established $146million follow-up fund was closed, of which the general partner subscribed $62million to invest in Web3 winners in the later stage
Implementation of JSTL custom function library
acwing 843. n-皇后问题
SQL where multiple field filtering
Is there any way to bookmark the code in the visual studio project- Is there a way to bookmark code in a Visual Studio project?
用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30
Win11玩绝地求生(PUBG)崩溃怎么办?Win11玩绝地求生崩溃解决方法