Monitoring method and monitoring system for JAVA process garbage collection
By obtaining and configuring the JVM identification information and monitoring parameters of the Java process, statistics of garbage collection indicators are solved, and the problems of low ease of use and high security risks of Java process garbage collection monitoring in the existing technology are solved, and a non-invasive and easy-to-use monitoring system is realized.
Patent Information
- Application Number
- CN202011200924.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-02
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2040-11-02
AI Technical Summary
The existing technology is low in the useability of monitoring Java processes when monitoring garbage collection, and relies on external tools and JMX protocols, which increases the security risks of the system and requires professional skills to configure.
By obtaining JVM identification information, configuring monitoring parameters, including garbage collection indicators for young and old generations, starting monitoring, collecting and counting JVM data, determining whether the garbage collection indicators meet the alarm standards, and realizing non-invasive monitoring.
It enables monitoring of JVM data without external tools and JMX protocol, reducing configuration complexity and security risks, and improving ease of use and applicability of monitoring.
Smart Images

Figure CN113010367B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource recovery of application programs, and more specifically, to a monitoring method for garbage recovery of a JAVA process. Background Art
[0002] During the running of a Java program, unnecessary objects are recycled to free up resources and space. The heap space is divided into three generations: young generation, old generation, and permanent generation. The young generation space is mostly small objects and is frequently recycled, and the garbage collection of the young generation heap space is more frequent. Long-lived objects in the young generation heap space are transferred (perhaps permanently) to the old generation heap space; this heap space is usually larger than the young generation heap space, and its space grows more slowly. The permanent generation heap space stores metadata for the VM and Java classes, as well as interned strings and static variables of the class.
[0003] Java programs use a garbage collector (GC) to recycle resources. It automatically allocates memory when creating an object, and automatically releases the memory used by the object when the object is no longer in use. During program execution, the garbage collector performs multiple garbage collection actions. For example, when the young generation heap space is tight, a minor collection action (MinorGC) will be triggered, which has a shorter recycling interval than a full collection action (Full GC). When the old generation or persistent generation heap space is full, a full collection action will be triggered, which is usually started explicitly.
[0004] Frequent garbage collection can cause program jams, while incomplete garbage collection can lead to problems such as memory overflow. In the process of developing large-scale Java applications, it is inevitable to encounter problems such as memory leaks and performance bottlenecks. For example, unreleased file, network, and database connections and unoptimized algorithms can cause these problems. As the application continues to run, the efficiency of the entire system may decrease, or even cause the system to crash.
[0005] There are usually two methods for monitoring garbage collection. One is to manually enter commands on the server to view. By controlling commands and corresponding parameter settings, relevant information of the JAVA virtual machine (JVM) at the current moment can be output from the console, and garbage collection data can also be continuously displayed on the terminal through commands. The second is to use similar GUI tools such as JConsole and VisualVM. By installing or configuring the client on the target monitoring system, or establishing a remote connection through the JMX protocol, these tools can connect to the target Java process and display garbage collection related data in a cumulative manner on a fixed panel. The above tools all rely on the JMX protocol or a specific Java daemon when monitoring the JVM. This requires configuration to support the JMX protocol and the corresponding port before the Java application is started, and different application middlewares have different ways to configure the JMX protocol. Using a daemon also requires configuring Java permission control and other operations on the target monitoring machine to start it. These operations require technicians with professional skills to perform, which reduces the ease of use of monitoring. In addition, opening the JMX protocol and the corresponding port also increases the risk of the target system being invaded. Summary of the invention
[0006] One aspect of the present invention is to provide a monitoring method for JAVA process garbage collection that can at least partially overcome the deficiencies of the prior art.
[0007] A monitoring method for JAVA process garbage collection includes: obtaining JVM identification information of a process to be monitored; configuring monitoring parameters; wherein the monitoring parameters include at least a young generation garbage collection indicator and an old generation garbage collection indicator; starting monitoring, collecting and saving JVM data of the process to be monitored; counting garbage collection actions contained in the JVM data to determine a young generation garbage collection indicator and an old generation garbage collection indicator; and determining whether the young generation garbage collection indicator and / or the old generation garbage collection indicator meet corresponding alarm standards based on the statistical results.
[0008] Optionally, the method further includes: determining that the second process to be monitored is a continuation process of the first process to be monitored based on that a JVM identification information of the second process to be monitored is the same as the corresponding JVM identification information of the first process to be monitored.
[0009] Optionally, the young generation garbage collection indicator includes a first average duration taken by the young generation garbage collection within a time period, and the old generation garbage collection indicator includes the amount of resources released by the old generation garbage collection, wherein the alarm criteria include: the first average duration is greater than the first monitoring threshold; and the amount of resources released is less than the second monitoring threshold.
[0010] Optionally, the old generation garbage collection indicator also includes the number of consecutive occurrences of the resource release amount being less than a release amount threshold, wherein the alarm standard further includes: the number of times is not less than a third monitoring threshold.
[0011] Another aspect of the present invention is to provide a monitoring system for JAVA process garbage collection that can at least partially overcome the deficiencies of the prior art.
[0012] The monitoring system for JAVA process garbage collection includes: a continuation process determination unit, configured to obtain JVM identification information of the process to be monitored; a monitoring parameter configuration unit, configured to accept user settings for monitoring parameters; wherein the monitoring parameters include at least a young generation garbage collection indicator and an old generation garbage collection indicator; a monitoring unit, configured to collect and save JVM data of the process to be monitored, and to count the garbage collection actions contained in the JVM data to determine the young generation garbage collection indicator and the old generation garbage collection indicator; an alarm unit, configured to determine whether the young generation garbage collection indicator and / or the old generation garbage collection indicator meet the corresponding alarm standards based on the statistical results.
[0013] Optionally, the continuation process determining unit is further configured to determine the second process to be monitored as a continuation process of the first process to be monitored based on that a JVM identification information of the second process to be monitored is the same as the corresponding JVM identification information of the first process to be monitored.
[0014] Optionally, the monitoring unit is also configured to determine a first average duration occupied by young generation garbage collection within a time period; and determine the amount of resource release generated by old generation garbage collection; wherein the alarm unit is configured to issue an alarm message based on the first average duration being greater than a first monitoring threshold; and to issue an alarm message based on the amount of resource release being less than a second monitoring threshold.
[0015] Optionally, the monitoring unit is further configured to determine the number of consecutive occurrences of the resource release amount being less than a release amount threshold; wherein the alarm unit is configured to issue an alarm message based on the number being not less than a third monitoring threshold.
[0016] The monitoring method and system for JAVA process garbage collection provided by the present invention count each garbage collection action from JVM data, and then determine whether the garbage collection index meets the set alarm standard. This method realizes monitoring JVM data in a non-invasive manner, does not rely on external tools, does not need to be adapted according to different middleware, and has wide applicability. For process start and stop, this monitoring method can also continue the previous monitoring process according to the obtained JVM identifier. In addition, this monitoring method is also conducive to protecting data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1A schematic flow chart of a method for monitoring garbage collection of a JAVA process according to a first embodiment is shown.
[0018] Figure 2 A module structure diagram of a monitoring system for JAVA process garbage collection according to a first embodiment is shown. DETAILED DESCRIPTION
[0019] Specific details are provided in the following description to provide a thorough understanding of the present invention. However, it will be clear to those skilled in the art that embodiments of the present invention may be implemented without these specific details. In the present invention, specific numerical references may be made, such as "first element", "second device", etc. However, specific numerical references should not be understood to be subject to their literal order, but should be understood to be different from "first element" and "second element".
[0020] The specific details proposed in the present invention are exemplary only, and the specific details may vary, but still fall within the spirit and scope of the present invention. The term "coupled" is defined as meaning directly connected to a component or indirectly connected to a component via another component. In addition, the terms "approximately" and "substantially" used herein for any numerical value or range indicate that deviations are appropriately allowed without affecting the implementation effect of the present invention.
[0021] Preferred embodiments suitable for implementing the methods, systems and devices of the present invention are described below with reference to the accompanying drawings. Although each embodiment is described for a single combination of elements, it should be understood that the present invention includes all possible combinations of disclosed elements. Therefore, if one embodiment includes elements A, B, and C, and a second embodiment includes elements B and D, the present invention should also be considered to include other remaining combinations of A, B, C, or D, even if not explicitly disclosed.
[0022] like Figure 1 As shown, the first embodiment of the present invention provides a monitoring method for JAVA process garbage collection, which includes the following steps S10-S12-S14-S16-S18. Figure 1 The order of the steps shown is fixed, but those skilled in the art will appreciate that these steps can be combined with each other or split into a plurality of different sub-steps for execution, without affecting the technical effects of the present invention. In some embodiments of the present invention, step S10 can be executed multiple times before or after other steps. In other embodiments of the present invention, steps S10 and S12 are executed when the monitoring program is first started, and steps S14, S16, and S18 are executed as each process to be monitored is determined, that is, after a new process to be monitored is added, steps S14, S16, and S18 are executed again, but there is no need to repeat steps S10 and S12.
[0023] Step S10: Obtain JVM identification information of the process to be monitored.
[0024] First, when determining the monitoring target, the IP address of the resource where the corresponding application is located, the user name and password that can be used to log in and execute monitoring-related commands can be added according to the number of monitoring targets. It is also possible to directly obtain the JAVA virtual machine identification information of one or more processes to be monitored. The identification information of the Java process to be monitored provided by the user or automatically filtered by the system can be the name or ID of the Java process, the corresponding user identifier or other JAVA virtual machine identification information, or some combination thereof. If it is a process name, the system can obtain its corresponding process ID through the jps command, but if there are multiple duplicate process names on a monitoring target, a clear process ID to be monitored can be provided.
[0025] During the monitoring operation, the monitoring method makes certain fault tolerance for the connection anomalies of the monitored process. Specifically, if the monitored Java process is restarted midway, the monitoring method can automatically obtain a new process ID after the process restarts through the previously saved Java process name after discovering the connection anomaly, and continue the previous monitoring process, thereby ensuring the continuity of monitoring. For example, when the monitoring method finds that a JVM identification information of the second monitored process is the same as the corresponding JVM identification information of the first monitored process, it can be determined that the second monitored process is a continuation of the first monitored process, and then, the monitoring of the first monitored process can be continued instead of starting a new monitoring. To this end, during the execution of the monitoring method, before or after steps S12-S14-S16-S18, the JVM identification information of each monitored process can be obtained multiple times to determine whether the monitored process is restarted or whether the new monitored process is actually a continuation of the previous monitored process.
[0026] Step S12: Configure monitoring parameters.
[0027] In step S12, the user configures monitoring parameters, which may include command parameters and environment parameters, monitoring duration, monitoring thresholds, etc. The monitoring parameters should include at least one young generation garbage collection indicator and one old generation garbage collection indicator. The monitoring threshold or alarm standard required in the following step S18 can also be set here. Other monitoring parameters are optional, and the user determines whether to configure them according to the specific application scenario.
[0028] In some embodiments of the present invention, the young generation garbage collection index includes the average duration of young generation garbage collection in a period of time, and the old generation garbage collection index includes the amount of resources released by old generation garbage collection. Accordingly, in the subsequent step S18, the alarm standard is set accordingly, as described in detail in the following step S18.
[0029] Step S14: Start monitoring, collect and save JVM data of the process to be monitored.
[0030] In step S14, as an example, by monitoring the IP of the target system, SSH is used to establish a link with the monitoring target system and complete the login, one or more monitored processes of the monitoring target are determined, and then a jstat command is composed according to the configured monitoring parameters and sent to the monitoring target. Whether the monitoring has been started can be determined based on whether the JVM data is obtained.
[0031] When the monitoring target remains unchanged, one or more processes to be monitored can be automatically screened out from the monitoring target according to the usage rate of memory or other resources, and the monitoring process can be started using the monitoring parameters configured in step S12 or the previous monitoring parameters. During the monitoring period, the JAVA virtual machine (JVM) data of each process to be monitored is collected and saved.
[0032] In some embodiments of the present invention, it is further determined whether the collected JVM data is legal. If it is legal, the data is formatted and then stored in the time series database. If the JVM data is illegal (usually because it is collected during process stop or restart), a new process ID is obtained according to the process name in a loop and a connection is established between the monitoring program and the new process, and the corresponding legal JVM data is continued to be collected.
[0033] In the following steps, the process to be monitored is referred to as the current monitoring process.
[0034] Step S16: Count the garbage collection actions included in the JVM data to determine the configured monitoring parameters.
[0035] In step S16, the JVM data is statistically analyzed. Since the JVM data contains records about multiple garbage collection actions, these garbage collection actions (including secondary collection actions, full collection actions, young generation garbage collection actions, old generation garbage collection actions, etc.) can be extracted and counted separately. For example, the number of various types of garbage collection actions and the duration of each garbage collection action are counted, so that the young generation garbage collection index and the old generation garbage collection index can be assigned a certain value, which is directly related to the currently monitored JAVA process. For different JAVA processes, the young generation garbage collection index and the old generation garbage collection index of the first process may be significantly different from the corresponding index of the second process. Depending on the situation, other configured monitoring parameters, such as command parameters and environment parameters, can also be determined (i.e., quantified), all of which are associated with the currently monitored process.
[0036] For example, in order to determine the two configured indicators, the cumulative value YGC of the number of collection actions in a certain time period and the cumulative value YGCT of the time taken can be calculated, and then the average duration of the young generation garbage collection in the time period can be calculated. Among them, YGCT is obtained by adding up the time taken by each collection action (MGC). The average duration can be calculated as follows: within the sliding time window of X minutes, the average GC duration of the young generation = (YGCT1 – YGCT0) / (YGC1 – YGC0). Among them, YGCT1 represents the cumulative value of the time taken by each collection action at the current time, and YGC1 represents the corresponding cumulative value of the number of times; and YGCT0 represents the cumulative value of the time taken by each collection action X minutes ago, and YGC0 represents the corresponding cumulative value of the number of times.
[0037] In a certain time window, the average GC of the young generation may not show any abnormality. However, as the time window slides, the JAVA processes with garbage collection problems will show abnormal trends in the young generation garbage collection indicators (or old generation garbage collection indicators) during continuous monitoring, which may cause early warning signals. When the early warning signals meet the corresponding alarm standards, alarm signals will be further issued.
[0038] Quantifying the configured monitoring parameters also includes determining the amount of resources released by the old generation garbage collection. The amount of resources released by the old generation GC can be calculated as: old generation resource capacity OC - old generation resource usage OU. The above resource release amount is calculated once each time a full collection action is triggered. The resource release amount is associated with the old generation garbage collection and changes over time.
[0039] Through step S16, the determined monitoring parameters can be obtained, which include at least quantized young generation garbage collection indicators and old generation garbage collection indicators. These indicators will change over time, thereby reflecting whether the current monitoring process has a bad trend in garbage collection.
[0040] Step S18: Determine whether the young generation garbage collection index and / or the old generation garbage collection index meet corresponding alarm standards based on the statistical results.
[0041] In step S18, the alarm criteria may be set to match the previously configured monitoring parameters. Specifically, the monitoring parameters include at least the young generation garbage collection index and the old generation garbage collection index, which are quantified in step S16. Accordingly, a first monitoring threshold is set for the young generation garbage collection index, and a second monitoring threshold is set for the old generation garbage collection index. When each index meets a specific relationship (greater than or less than, etc.) with the corresponding monitoring threshold, it is determined to meet the alarm criteria, and an alarm signal may be issued.
[0042] Taking the example that the young generation garbage collection indicator includes the average duration occupied by the young generation garbage collection in a time period (hereinafter referred to as the first average duration), and the old generation garbage collection indicator includes the amount of resources released by the old generation garbage collection, the alarm standard can be set to include the first sub-standard: the first average duration is greater than the first monitoring threshold (for example, 0.2 seconds), and the second sub-standard: the amount of resources released is less than the second monitoring threshold (in M bytes, for example, 50M). The system can send an alarm signal when the first sub-standard or the second sub-standard is met. Alternatively, the system administrator can set it to send an alarm signal only when both the first and second sub-standards are met. In some embodiments, the old generation garbage collection indicator may also include the number of consecutive occurrences of the situation where the amount of resource release is less than the release threshold. Accordingly, the alarm standard includes a third sub-standard: the number of consecutive occurrences of this situation is not less than the third monitoring threshold.
[0043] In other embodiments, the monitoring method for JAVA process garbage collection also includes determining whether the average duration (hereinafter referred to as the second average duration) occupied by the full collection action is greater than the fourth monitoring threshold based on the statistical results obtained in step S16. It is understandable that the second average duration will also change dynamically with the movement of the monitoring time window. The full collection action includes a complete garbage collection of the young generation, old generation and persistent generation heap space. Depending on the size of the heap, the time consumed by the full collection action is also different, but if its average duration exceeds 3-5 seconds, it may indicate that there is a problem with the garbage collection of the persistent generation heap space. In this regard, the system can be set to issue a warning signal or alarm information when the second average duration is greater than the fourth monitoring threshold.
[0044] As described above, in some embodiments of the present invention, there are both early warning signals and alarm signals. The alarm signal is issued when the early warning signal meets the alarm criteria (for example, the early warning signal persists and shows an increasing trend in intensity, or the continuous early warning signal indicates the opposite information and the intensity is higher than the threshold). The early warning signal can notify the technician to pay attention or intervene in advance to prevent the JAVA process from being abnormal. The alarm signal will trigger further exception handling procedures. According to an exception handling procedure, the system will execute the corresponding dump command, collect more detailed process data from the JVM and store it in the database; after a preset time interval, the next monitoring will be started.
[0045] According to some embodiments of the present invention, the monitoring method also includes displaying the JVM data of the current monitoring process and the specific values of the young generation garbage collection indicators and the old generation garbage collection indicators that meet the alarm standards to the user or administrator in a graphical manner, and can further display their comparisons with the corresponding monitoring thresholds. As an example, it can also be combined with a third-party monitoring system (such as Grafana), and the monitoring method can provide JVM data stored in a time series database. Multiple users can browse the formatted data of the stored JVM in a graphical manner at any time, including the changes in the available space size and the current used size of each part of the JVM over time, the changes in the number and time of YGC and FGC over time, and display them in different formats according to actual needs.
[0046] The above provides various embodiments of the monitoring method for JAVA process garbage collection, which automatically extracts and counts each garbage collection action from JVM data, and determines whether the garbage collection index meets the alarm standard based on the statistical results. It has at least the following technical effects: 1) Monitor JVM data in a non-invasive manner without relying on JMX tools; 2) No additional adaptation is required according to different middlewares, and it can be applied to any Java process; 3) For process start and stop, the monitoring method automatically switches the process according to the obtained JVM identifier without human intervention; 4) The monitoring data is persisted and saved, based on which a flexible and multi-mode display is achieved; 5) Supports multi-user real-time multi-entry collaborative monitoring and analysis of the monitoring target system; 6) Automated performance testing is achieved.
[0047] The second embodiment of the present invention provides a monitoring system 20 for JAVA process garbage collection, the system comprising a monitoring parameter configuration unit 201, a monitoring unit 203, a continuation process determination unit 205, an alarm unit 207 and an optional graphic display unit 209, the coupling (connection) relationship between the units is as follows: Figure 2 shown.
[0048] Among them, the monitoring parameter configuration unit 201 opens a parameter configuration interface to the user and can accept the user's setting of the monitoring parameters. On the one hand, the monitoring unit 203 is coupled with the monitoring parameter configuration unit 201 to obtain the monitoring parameters set by the user. The monitoring parameters at least include the young generation garbage collection index and the old generation garbage collection index. On the other hand, the monitoring unit 203 also collects and saves JVM data from the process to be monitored, and counts the garbage collection actions contained therein. The continuation process determination unit 205 is coupled to the monitoring unit 203, and is configured to obtain the JVM identification information of the process to be monitored and transmit it to the monitoring unit 203. The alarm unit 207 is coupled to the monitoring unit 203, and is configured to determine whether the young generation garbage collection index and / or the old generation garbage collection index meet the corresponding alarm standard based on the statistical results of the monitoring unit 203. The graphic display unit 209 is configured to display the JVM data of the process to be monitored and the young generation garbage collection index and the old generation garbage collection index that meet the alarm standard in a graphical manner.
[0049] Specifically, the continued process determination unit 205 can determine the second process to be monitored as the continued process of the first process to be monitored based on the fact that one JVM identification information of the second process to be monitored is the same as the corresponding JVM identification information of the first process to be monitored. In this way, even if the process to be monitored is restarted midway, the continued process determination unit 205 can match the previously saved JVM identification information with the JVM identification information automatically obtained after the process is restarted after the connection abnormality is found, thereby continuing the previous monitoring process.
[0050] In some embodiments, the monitoring unit 203 may determine the first average duration occupied by the young generation garbage collection and the amount of resources released by the old generation garbage collection within a time period; accordingly, the alarm unit 207 issues an alarm message based on the first average duration being greater than the first monitoring threshold, and may also issue an alarm message based on the amount of resources released being less than the second monitoring threshold. According to a further improved embodiment, the monitoring unit 203 may also determine the number of consecutive occurrences of the amount of resource release being less than the release threshold; accordingly, the alarm unit 207 issues an alarm message based on the number being not less than the third monitoring threshold. In the case where attention needs to be paid to the garbage collection of the persistent heap space, the monitoring unit 303 may determine whether the second average duration occupied by the full collection action is greater than the fourth monitoring threshold, and may further issue a warning signal or an alarm signal.
[0051] In some embodiments of the present invention, when the alarm unit 207 determines whether to issue an alarm message, the monitoring thresholds it relies on are from the parameter setting process of the user for the monitoring parameter configuration unit 201. Alternatively, the monitoring thresholds that the alarm unit 207 relies on are from the machine learning process of the alarm unit 207. In this case, the alarm unit 207 receives user feedback on monitoring results and alarm messages, and determines the monitoring thresholds through training and testing of a multi-layer neural network and a genetic algorithm.
[0052] In some embodiments of the present invention, the monitoring unit 203 and the alarm unit 207 included in the monitoring system 20 can be merged into one unit, which collects and saves JVM data from the process to be monitored, counts the garbage collection actions contained therein, calculates the young generation garbage collection indicators and the old generation garbage collection indicators, and further determines whether these indicators meet the corresponding monitoring thresholds.
[0053] In some embodiments of the present invention, at least a portion of the above-mentioned monitoring system can be implemented using a group of distributed computing devices connected by a communication network, or based on the "cloud". In such a system, multiple computing devices work together to provide services by using their shared resources. The "cloud"-based implementation can provide one or more advantages, including: openness, flexibility and scalability, central management, reliability, and the ability to aggregate and analyze information across multiple users.
[0054] It will be appreciated by those skilled in the art that the various illustrative logic blocks, modules, circuits and algorithmic steps described in conjunction with the aspects disclosed herein can be implemented as electronic hardware, computer software or a combination of the two. In order to show the interchangeability between hardware and software, various illustrative components, blocks, modules, circuits and steps are generally described above according to their functionality. Whether such functionality is implemented as hardware or software will depend on the specific application and the design restrictions imposed on the overall system. The technician can implement the described functionality in a varying manner for a specific specific application, but such implementation decision should not be understood as causing a departure from the scope of the invention.
[0055] The above description is only for the preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Those skilled in the art may make various modified designs without departing from the concept of the present invention and the accompanying claims.
Claims
1. A monitoring method for JAVA process garbage collection, comprising: Get the JVM identification information of the process to be monitored; Configure monitoring parameters; wherein the monitoring parameters include at least one young generation garbage collection index and one old generation garbage collection index; Start monitoring, collect and save JVM data of the process to be monitored; Counting the garbage collection actions included in the JVM data to determine the young generation garbage collection index and the old generation garbage collection index; Determine based on the statistical results whether the young generation garbage collection index and / or the old generation garbage collection index meet the corresponding alarm criteria, The young generation garbage collection indicator includes a first average duration occupied by young generation garbage collection in a time period, and the old generation garbage collection indicator includes the amount of resource release generated by old generation garbage collection, wherein the alarm standard includes: the first average duration is greater than a first monitoring threshold; and The resource release amount is less than a second monitoring threshold, The old generation garbage collection indicator also includes the number of times the resource release amount is less than a release amount threshold value, and the alarm standard further includes: The number of times is not less than a third monitoring threshold.
2. The monitoring method according to claim 1, further comprising: Based on the fact that a JVM identification information of the second process to be monitored is the same as the corresponding JVM identification information of the first process to be monitored, it is determined that the second process to be monitored is a continuation process of the first process to be monitored.
3. The monitoring method according to claim 1, further comprising: Based on the statistical result, it is determined whether the second average duration occupied by the full collection action is greater than a fourth monitoring threshold.
4. The monitoring method according to any one of claims 1 to 3, further comprising: The JVM data of the process to be monitored and the young generation garbage collection indicators and the old generation garbage collection indicators that meet the alarm criteria are displayed in a graphical manner.
5. A monitoring system for JAVA process garbage collection, comprising: A continuation process determination unit is configured to obtain JVM identification information of the process to be monitored; A monitoring parameter configuration unit, configured to accept a user's setting of monitoring parameters; wherein the monitoring parameters include at least one young generation garbage collection index and one old generation garbage collection index; A monitoring unit configured to collect and save JVM data of the process to be monitored, and to count garbage collection actions contained in the JVM data to determine the young generation garbage collection index and the old generation garbage collection index; an alarm unit, configured to determine whether the young generation garbage collection index and / or the old generation garbage collection index meets corresponding alarm criteria based on the statistical results, Wherein, the monitoring unit is further configured to: Determining a first average duration of young generation garbage collection over a time period; and Determine the amount of resources released by old generation garbage collection; Wherein, the alarm unit is configured as: issuing an alarm message based on that the first average duration is greater than a first monitoring threshold; and Based on the resource release amount being less than the second monitoring threshold, an alarm message is issued, Wherein, the monitoring unit is further configured to: Determine the number of times the resource release amount is less than a release amount threshold value; Wherein, the alarm unit is configured as: An alarm message is issued based on the number of times being no less than a third monitoring threshold.
6. The monitoring system according to claim 5, characterized in that: The continuation process determination unit is further configured to: Based on the fact that a JVM identification information of the second process to be monitored is the same as the corresponding JVM identification information of the first process to be monitored, the second process to be monitored is determined as a continuation process of the first process to be monitored.
7. The monitoring system according to claim 5, characterized in that: The monitoring unit is also configured to: It is determined whether the second average duration of the full collection action is greater than a fourth monitoring threshold.
8. The monitoring system according to any one of claims 5 to 7, further comprising: The graphic display unit is configured to display the JVM data of the process to be monitored and the young generation garbage collection index and the old generation garbage collection index that meet the alarm standard in a graphical manner.
Citation Information
Patent Citations
Memory garbage collecting method and device for Java virtual machine
CN103514102A