当前位置:网站首页>[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
边栏推荐
- Take you ten days to easily complete the go micro service series (IX. link tracking)
- 整理混乱的头文件,我用include what you use
- [pure tone hearing test] pure tone hearing test system based on MATLAB
- 【海浪建模3】三维随机真实海浪建模以及海浪发电机建模matlab仿真
- Hand drawn video website
- 有哪些收益稳定的理财产品,这两个都不错
- Pycharm professional download and installation tutorial
- URLs and URIs
- dotnet-exec 0.6.0 released
- Query for Boolean field as "not true" (e.g. either false or non-existent)
猜你喜欢
What you learned in the eleventh week
ORB(Oriented FAST and Rotated BRIEF)
FEG founder rox:smartdefi will be the benchmark of the entire decentralized financial market
Call Huawei order service to verify the purchase token interface and return connection reset
Talking about JVM 4: class loading mechanism
[wave modeling 2] three dimensional wave modeling and wave generator modeling matlab simulation
Distributed base theory
College degree, what about 33 year old Baoma? I still sell and test, and my monthly income is 13K+
各大主流编程语言性能PK,结果出乎意料
Operator explanation
随机推荐
Poap: the adoption entrance of NFT?
Oracle case: SMON rollback exception causes instance crash
Basic concept and usage of redis
lambda expressions
Take you ten days to easily complete the go micro service series (IX. link tracking)
Visual explanation of Newton iteration method
Distributed base theory
Digital DP template
npm install报错 强制安装
Compare whether two lists are equal
26.2 billion! These universities in Guangdong Province have received heavy support
Open3d uses GICP to register point clouds
Mongodb series learning notes tutorial summary
Postman automatically fills headers
How to use words to describe breaking change in Spartacus UI of SAP e-commerce cloud
Take you ten days to easily complete the go micro service series (IX. link tracking)
Learn C language from scratch day 024
Inventory of more than 17 typical security incidents in January 2022
User login function: simple but difficult
Innovation leads the direction. Huawei Smart Life launches new products in the whole scene