当前位置:网站首页>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 .
边栏推荐
- AI 落地新题型 RPA + AI =?
- 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?
- acwing 843. n-皇后问题
- C # use Siemens S7 protocol to read and write PLC DB block
- Kotlin compose text supports two colors
- mpf2_ Linear programming_ CAPM_ sharpe_ Arbitrage Pricin_ Inversion Gauss Jordan_ Statsmodel_ Pulp_ pLU_ Cholesky_ QR_ Jacobi
- B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
- How to open win11 remote desktop connection? Five methods of win11 Remote Desktop Connection
- 九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
- 未婚夫捐5亿美元给女PI,让她不用申请项目,招150位科学家,安心做科研!
猜你喜欢
Case reward: Intel brings many partners to promote the innovation and development of multi domain AI industry
[ArcGIS tutorial] thematic map production - population density distribution map - population density analysis
Camera calibration (I): robot hand eye calibration
MySQL forgot how to change the password
九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
树与图的深度优先遍历模版原理
How to solve the problem of adding RTSP device to easycvr cluster version and prompting server ID error?
EasyCVR视频广场点击播放时,主菜单高亮效果消失问题的修复
Win11图片打不开怎么办?Win11无法打开图片的修复方法
Vscode 如何使用内置浏览器?
随机推荐
Practice Guide for interface automation testing (middle): what are the interface testing scenarios
NanopiNEO使用开发过程记录
Up to 5million per person per year! Choose people instead of projects, focus on basic scientific research, and scientists dominate the "new cornerstone" funded by Tencent to start the application
【自动化经验谈】自动化测试成长之路
Kivy tutorial of setting the size and background of the form (tutorial includes source code)
高薪程序员&面试题精讲系列120之Redis集群原理你熟悉吗?如何保证Redis的高可用(上)?
数学分析_笔记_第10章:含参变量积分
[multi threading exercise] write a multi threading example of the producer consumer model.
Win11图片打不开怎么办?Win11无法打开图片的修复方法
每人每年最高500万经费!选人不选项目,专注基础科研,科学家主导腾讯出资的「新基石」启动申报
What if the win11 screenshot key cannot be used? Solution to the failure of win11 screenshot key
九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
The root file system of buildreoot prompts "depmod:applt not found"
Golang calculates constellations and signs based on birthdays
英特尔David Tuhy:英特尔傲腾技术成功的原因
C#使用西门子S7 协议读写PLC DB块
Have you got the same "artifact" of cross architecture development praised by various industry leaders?
Complimentary tickets quick grab | industry bigwigs talk about the quality and efficiency of software qecon conference is coming
SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
Lessons and thoughts of the first SQL injection