当前位置:网站首页>[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
边栏推荐
- [untitled]
- Mongodb series learning notes tutorial summary
- Deux nombres se remplacent
- Pycharm professional download and installation tutorial
- Recursive execution mechanism
- Discrete mathematics: propositional symbolization of predicate logic
- Daily practice (18): stack containing min function
- 【FPGA教程案例10】基于Verilog的复数乘法器设计与实现
- [wave modeling 2] three dimensional wave modeling and wave generator modeling matlab simulation
- POAP:NFT的采用入口?
猜你喜欢
Playwright recording
Complete knapsack problem (template)
SAP ui5 application development tutorial 107 - trial version of SAP ui5 overflow toolbar container control introduction
What did I pay for it transfer to testing post from confusion to firmness?
1189. Maximum number of "balloons"
揭露测试外包公司,关于外包,你或许听到过这样的声音
Grabbing and sorting out external articles -- status bar [4]
107. SAP UI5 OverflowToolbar 容器控件以及 resize 事件处理的一些细节介绍
Insert sort of sort
Arbitrum: two-dimensional cost
随机推荐
lambda expressions
【Unity】InputSystem
Applet live + e-commerce, if you want to be a new retail e-commerce, use it!
Several simplified forms of lambda expression
Intel sapphire rapids SP Zhiqiang es processor cache memory split exposure
(script) one click deployment of any version of redis - the way to build a dream
College degree, what about 33 year old Baoma? I still sell and test, and my monthly income is 13K+
Playwright之录制
||Interview questions you will encounter
Kibana index, mapping, document operation
I was beaten by the interviewer because I didn't understand the sorting
Check if this is null - checking if this is null
【C】 (written examination questions) pointer and array, pointer
Take you ten days to easily complete the go micro service series (IX. link tracking)
dotnet-exec 0.6.0 released
1189. Maximum number of "balloons"
SAP UI5 应用开发教程之一百零七 - SAP UI5 OverflowToolbar 容器控件介绍的试读版
Expose testing outsourcing companies. You may have heard such a voice about outsourcing
"Upside down salary", "equal replacement of graduates" these phenomena show that the testing industry has
Poap: the adoption entrance of NFT?