In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to troubleshoot the memory leak of the server". In the daily operation, I believe that many people have doubts about how to troubleshoot the memory leak of the server. The editor consulted all kinds of data and sorted out the simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "how to troubleshoot the memory leak of the server"! Next, please follow the editor to study!
Jps-l
Check which process the virtual machine belongs to
Jstat-gcutil 20954 1000
The new Eden zone (E, stands for Eden) uses 28.30% (last) of the space.
The two Survivor zones (S0, S1, representing Survivor0 and Survivor1) are 0 and 8.93%, respectively.
The old age (O, stands for Old) used 87.33%.
Minor GC (YGC, which stands for Young GC) has occurred 101 times since the program was run, with a total time of 1.961 seconds.
Full GC (FGC, which means Full GC) occurs 7 times, and the total Full GC takes 3.022 seconds.
The total time spent (GCT, which means GC Time) is 4.983 seconds.
Check every 1000 milliseconds, all the time.
Gcutil means the percentage of total space used by the space station.
The query results show that the
Jmap-histo:live 20954
You can see that there are more than 50 million elements in HashTable, taking up about 1.5 gigabytes of memory. This can't be normal.
Live is an optional parameter that represents the surviving object
Red line part:
MAT analysis tool
Shortest Paths To the Accumulation Point represents the shortest path from GC root to the memory consumption aggregation point
All Accumulated Objects by Class enumerates all the contents stored in the object
To find the memory leak, I got two heap dump files with an interval of one day
By comparing the objects of the two files, it is easy to locate memory leaks by comparing the results.
MAT opens two heap dump files at the same time, and opens Histogram
The box 1 button in the figure below is used to compare the two Histogram. After the comparison, select Group By package at box 2, and then compare the changes of each object.
-64 means that there are 64 fewer objects in the former than in the latter.
My memory leak location is a list, this list just keeps adding eventInfo objects to it, but it hasn't been released.
Find the code you are familiar with.
At the same time, it will jump from the home page to the Leak Suspects page.
Jmap-dump:format=b,file=
MemoryAnalyzer.ini file
Xmx parameter, which represents the maximum memory usage. The default is 1024m.
Jmap is more general, and obvious problems can be detected.
Supplement jmap online analysis and modify MAT configuration
Get the .hprof file from jmap
Select Leak Suspects Report and Finish can go to the home page of the MAT analysis page.
The more useful ones on the home page are Histogram and Leak Suspects
Clicking Leak Suspects will generate a Leak Suspects.zip file in the same directory as the heap dump file.
After decompressing the file, you can open the analysis result through the browser.
Leak Suspects page
Click Details to enter the details page
At this point, the study on "how to troubleshoot the memory leak of the server" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.