当前位置:网站首页>[development of large e-commerce projects] performance pressure test - Performance Monitoring - heap memory and garbage collection -39
[development of large e-commerce projects] performance pressure test - Performance Monitoring - heap memory and garbage collection -39
2022-07-05 01:01:00 【Random stone light】
One : Performance monitoring jvm Memory model
1. Program counter Program Counter Register
- It records the address of the virtual machine bytecode instruction being executed ,
- This memory area is the only one in JAVA Nothing is specified in the virtual machine specification OutOfMemoryError Region
2. virtual machine VM Stack
- Describe the JAVA Memory model for method execution , Each method creates a stack frame when it executes , Used to store local variables , The stack of operands , Dynamic links , Method interface, etc
- The local variable table stores various basic data types known at compile time 、 Object reference
- If the stack depth requested by thread is not enough, it will report StackOverflowError abnormal
- If the dynamic expansion capacity of the stack is not enough, it will be reported that OutOfMemoryError abnormal
- The virtual machine stack is thread isolated , That is, each thread has its own independent virtual machine stack
3. Local method Native Stack
- The local method stack is similar to the virtual machine stack , It's just that the local method stack uses local methods
4. Pile up Heap
- Almost all object instances allocate memory on the heap
Two : Pile up
All object instances and arrays are allocated on the heap . The heap is the main area managed by the garbage collector , Also known as “GC Pile up ”; It's also the place that we consider most about optimization . Heaps can be subdivided into :
1. The new generation :Eden Space 、From Survivor Space 、To Survivor Space
2. Old age
3. Forever / Meta space :Java8 The old generation , suffer jvm management ,java8 After the meta space , Use physical memory directly . therefore , By default , The size of the meta space is limited only by local memory .
from Java8 Start ,HotSpot It has been completely replaced forever (Permanent Generation) remove , Instead, a A new area — Meta space (MetaSpace)
- After object creation , Go to the Cenozoic area first , If you can't put it down , Then take GC Garbage collection . Then go to the Cenozoic area , If you still can't put it down , Just go to the elderly area
- The elderly area is a situation that cannot be handled by the Cenozoic area , Will go in . If the elderly area can be put down , Then allocate memory . If you still can't put it down , Then carry out comprehensive GC
- If you still can't put it down , Memory overflow exception will be reported
- Elderly areas generally store objects with long-lasting vitality and large objects
- Eden The park can be put into the survivor area , If you can't put it in, put it in the elderly area
3、 ... and :jconsole And jvisualvm( Monitor local and remote applications )
Jdk Two of my little tools jconsole、jvisualvm( Upgraded version jconsole); Start... From the command line , Can monitor local and local Remote applications . Remote applications need to be configured
1.jconsole
1) Get into jconsole
win+r Get into cmd, Input jconsole
Double click the service you want to connect
2) View monitoring information
2.jvisualvm( Recommended )
1) start-up
win+r Get into cmd, Input jvisualvm
2)jvisualvm Can do
Monitor memory leaks , Tracking garbage collection , Memory at execution time 、cpu analysis , Thread analysis …
function : Running
Sleep :sleep
wait for :wait
Resident : Idle threads in the thread pool
monitor : Blocked threads , Waiting for lock
3) Install plug-ins for easy viewing of garbage collection (gc)
- Tools -> plug-in unit
- Available plug-ins -> Check for version updates
- If 503 Error resolution :
Open the urlhttps://visualvm.github.io/pluginscenters.html
cmd Check out your jdk edition , Find the corresponding - Copy the links found below . And reset it
- download gc plug-in unit
- see gc
边栏推荐
- Innovation leads the direction. Huawei Smart Life launches new products in the whole scene
- Hand drawn video website
- What did I pay for it transfer to testing post from confusion to firmness?
- Open3d uses GICP to register point clouds
- [untitled]
- 兩個數相互替換
- Hologres query management and timeout processing
- 2022.07.03(LC_6109_知道秘密的人数)
- npm install报错 强制安装
- Playwright recording
猜你喜欢
【海浪建模1】海浪建模的理论分析和matlab仿真
npm install报错 强制安装
LeetCode周赛 + AcWing周赛(T4/T3)分析对比
Basic operations of database and table ----- create index
Relationship between classes and objects
抓包整理外篇——————状态栏[ 四]
Chia Tai International Futures: what is the master account and how to open it?
那些一门心思研究自动化测试的人,最后都怎样了?
2022.07.03(LC_6108_解密消息)
4. Scala writes HelloWorld in idea, in-depth analysis of accompanying objects, and association of source packages
随机推荐
【海浪建模3】三维随机真实海浪建模以及海浪发电机建模matlab仿真
[Yocto RM]10 - Images
URLs and URIs
npm install报错 强制安装
【selenium自动化】常用注解
揭露测试外包公司,关于外包,你或许听到过这样的声音
全栈开发提效神器——ApiFox(Postman + Swagger + Mock + JMeter)
Take you ten days to easily complete the go micro service series (IX. link tracking)
User login function: simple but difficult
NPM install error forced installation
Implementation steps of master detail detail layout mode of SAP ui5 application
||Interview questions you will encounter
Hill sort of sorting
SAP UI5 应用的主-从-从(Master-Detail-Detail)布局模式的实现步骤
What happened to those who focused on automated testing?
Hand drawn video website
Discrete mathematics: Main Normal Form (main disjunctive normal form, main conjunctive normal form)
创新引领方向 华为智慧生活全场景新品齐发
【C】(笔试题)指针与数组,指针
MySQL uses the explain tool to view the execution plan