Java garbage collection monitoring method and terminal
A technology for monitoring terminals and garbage, applied in the field of Java programming, can solve problems such as unavailability, insufficient system resources, impact on system availability, etc., and achieve the effect of intelligent monitoring
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0067] Please refer to figure 1 , Embodiment 1 of the present invention is:
[0068] A method for monitoring Java garbage collection, comprising steps:
[0069] S1. Obtain the business execution time and GC execution time within a GC cycle in the JVM;
[0070] Set a business execution and a GC execution that are adjacent to each other as a GC cycle; under normal circumstances, the GC execution time in each GC cycle will be within a certain range. If there is an exception, the GC execution time will be longer big increase;
[0071] In an optional implementation manner, the IP address of an application in the JVM and the service execution time and GC execution time within a GC cycle are obtained;
[0072] S2. Judging whether the GC cycle is normal according to the business execution time and the GC execution time, if not, recording the GC execution time into the GC cumulative time, specifically:
[0073] S21. Determine the business execution time weighting parameter accordin...
Embodiment 2
[0087] Apply the above-mentioned Java garbage collection monitoring method to actual scenarios:
[0088] S1. Obtain the business execution time of 9.8s and the GC execution time of 0.2s within a GC cycle of an application in the JVM; the initial cumulative GC time is 0;
[0089] S2. Calculate 0.2 / 9.8=1 / 49, obtain the preset multiple of 5, then 1 / 49×5 obtains the business execution time weighted parameter 5 / 49;
[0090] In an optional implementation manner, the int type is used to store the weighted parameters of the service execution time;
[0091] 9.8×5 / 49 get the weighted business execution time 1s;
[0092] 1s>0.2s, the GC cycle is normal, and the GC cumulative time remains 0;
[0093] S3. The preset judgment period is 24 hours. During the judgment period, the business execution time of the GC cycle and the GC execution time are continuously obtained, and it is judged whether the accumulated GC time exceeds the threshold of 30s within 24 hours. If so, it is judged that th...
Embodiment 3
[0097] Please refer to figure 2 , Embodiment three of the present invention is:
[0098] A Java garbage collection monitoring terminal 1, comprising a processor 2, a memory 3 and a computer program stored on the memory 3 and operable on the processor 2, the processor 2 implements the embodiment when executing the computer program Each step in one or embodiment two.
[0099]To sum up, the present invention provides a Java garbage collection monitoring method and terminal, which can monitor the business execution time and GC execution time in a GC cycle of different applications respectively, and use an adjacent business execution and a GC execution as the A GC cycle can subdivide the overall monitoring of the system into monitoring whether abnormalities occur in each time period, that is, to judge whether the weighted business execution time is greater than the GC execution time, if so, it means that the GC cycle is abnormal, and the GC execution time is reduced The de-weigh...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 

