当前位置:网站首页>JVM visualvm: multi hop fault handling tool

JVM visualvm: multi hop fault handling tool

2022-07-24 11:32:00 Carefree hero

VisualVM What is it? ?

    VisualVM(All-in-One Java Troubleshooting Tool) It is one of the most powerful operation monitoring and fault handling programs , It used to be... For a long time Oracle Official failure handling tools for virtual machines .

VisualVM What can be done ?

    VisualVM Can run monitoring 、 Troubleshooting , Other capabilities will also be provided , For example, performance analysis (Profiling).VisualVM Compared with JProfiler、YourKit Etc. professional and charged Profiling Tools are no less than .

VIsualVM function

     Show virtual machine processes and process configuration 、 environmental information (jps、jinfo).

· Monitor the application's processor 、 garbage collection 、 Pile up 、 Method area and thread information (jstat、jstack).

·dump And analyze heap dump snapshot (jmap、jhat).

· Method level program performance analysis , Find the most called 、 The longest way to run .

· Offline program snapshot : Collect the runtime configuration of the program 、 Threads dump、 Memory dump Wait for the information to create a snapshot , You can send the snapshot to the developer Bug feedback .

· The unlimited possibilities of other plug-ins .

Download and install

https://visualvm.github.io/index.html

bbe638b2de1ec74bf0f17a134800b87e.png

8eb9326691585929544e51b18f0400b7.png

decompression

Get into etc open visualvm.conf

35ee5e274e5bbf26fd2f25b8326da95f.png

edit jdk Lu Jin , Your own jdk Lu Jin

1ba529235b81ba93eabea637d8258a08.png

function

be6f3392f5577483d662227ce8a5bfaf.png

7dc3a36441861d0be67d17fed63762c0.png

Installing a plug-in

https://visualvm.github.io/pluginscenters.html

0a8d919de27982442bf0e614aff8e4fe.png

24243e775cb6a7e2ca6bc3a71d752de0.png

toos->plugins-> Change address

iy uj

cbfd2082d46d18d192da53c3a9cca2e1.png

a4abb052810d8543fa8923047879aad6.png

Download plug-ins

Note that if it is a virtual machine, use the virtual machine to download

c710d73e3ae5fa3f733d29fe42c44c90.png

2ca52cd1fa2577db4e18ee6e266de647.png

tools->Plugins->Downloaded

39a8f1ab65b9547d611544924ce3dbcf.png

Import the plug-in and install, And on again VigualVM

034232e0d9556f5311204c574d090fa9.png

If necessary, you can also install others

3bd0eeb0a64d8e12cd8466c5ba2ceb63.png

idea Installing a plug-in

Get into settings->plugins->Browse Repositories Search for :VisualVM

0a0563a3e1d6966f0db7fef5cb194a5b.png

35c30ca87aa57e67b7cdfd702b8904ec.png

Configure road force operation and jdk Catalog

111832ebaa1821eaddd69c86ac85b702.png

Run selection

da5c6a1e0f4493ae1fa633d0c3cbd8be.png

cb8522111c73cf5283ed3c9379148d9c.png

Related instructions :

Pile up (Heap) :JVM The managed memory is called heap

generational : According to the life cycle of the object , Divide the heap into 3 Generations :Young,Old and Permanent, Different collection algorithms are adopted according to the characteristics of different generations , Develop strengths and avoid weaknesses .

    Young( The younger generation )

The younger generation is divided into three sections . One Eden District , Two Survivor District . Most objects in Eden In the region . When Eden Area is full , Surviving objects will be copied to Survivor District ( One of the two ), When this Survivor Area is full , The surviving object in this section will be copied to another Survivor District , When this Survivor When the district is full , From the first Survivor The copied object that is still alive at this time , Will be copied “ Years old (Tenured)”. We need to pay attention to ,Survivor The two regions are symmetric , It doesn't matter , So it's possible to have a slave in the same region at the same time Eden Copy the object , And the old one Survivor The copied object , And the only copy to the old area is from the first one Survivor The copied object . and ,Survivor One of the sections is always empty .

    Tenured( The old generation )

The old store objects that survive from the young . Generally speaking, the objects stored by the old generation are the objects with longer life span .

    Perm( Lasting generation )

For storing static files , Now Java class 、 Such method . Persistence has no significant effect on garbage collection , But some applications may dynamically generate or call some class, for example Hibernate etc. , In this case, you need to set up a large persistence generation space to store the newly added classes in the running process . Persistent generation size through -XX:MaxPermSize= Set it up .

    Metaspace( Meta space )

          With JDK8 The arrival of the ,JVM No more Perm. But the metadata information of the class (metadata) still , It's just that it's no longer stored in contiguous heap space , It's moving to something called “Metaspace” Local memory of (Native memory) in . The essence of meta space is similar to permanent generation , All right. JVM Implementation of method area in specification . But the biggest difference between Metaspace and permanent generation is : The meta space is not in the virtual machine , It's using local memory .

Thread view

b8d78ec0b12fc3a5599847064315c0b7.png

CPU see

e1f9c19b07c34d3b6340e1c6cf5ae92c.png

bef2b044df69156b2c584504e46f4cf0.png

Generate dump

723620421723ae07e6acd84b1f1c8c03.png

Last

     use visualvm To analyze the performance of applications is also a very useful tool , Before the open source tools of cloud services and major platforms came out , This tool has always been treated as an artifact , Now, some of the analysis tools provided by major cloud services are more convenient 、 More efficient, so visualvm Although not the same as before, it is regarded as a requirement for performance analysis , But the value of this tool is still very high , Students in need can understand and master by themselves , Maybe this artifact will be used when upgrading to fight monsters .

Reference article :

    https://blog.csdn.net/xlecho/article/details/103814673

    https://www.ibm.com/developerworks/cn/java/j-lo-visualvm/

5e9288b199df4f6096a564a80c4278b4.png

原网站

版权声明
本文为[Carefree hero]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/203/202207221008110185.html