CN113157401A - Java virtual machine management method and device - Google Patents

Java virtual machine management method and device Download PDF

Info

Publication number
CN113157401A
CN113157401A CN202110555495.4A CN202110555495A CN113157401A CN 113157401 A CN113157401 A CN 113157401A CN 202110555495 A CN202110555495 A CN 202110555495A CN 113157401 A CN113157401 A CN 113157401A
Authority
CN
China
Prior art keywords
virtual machine
java virtual
parameter information
level parameter
thread
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110555495.4A
Other languages
Chinese (zh)
Inventor
朱洲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202110555495.4A priority Critical patent/CN113157401A/en
Publication of CN113157401A publication Critical patent/CN113157401A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a Java virtual machine management method and a device, and the method comprises the steps of obtaining thread level parameter information and process level parameter information in the running process of a Java virtual machine, analyzing the process level parameter information and the thread level parameter information, determining whether an abnormal target exists in the Java virtual machine, and if so, sending a control instruction to the Java virtual machine. By reconstructing the class method in the Java virtual machine, more comprehensive and more precise parameter information of the Java virtual machine in operation can be acquired, the parameter information can be analyzed in time to determine whether an abnormal target exists in the Java virtual machine, and when the abnormal target appears in the Java virtual machine, the Java virtual machine is actively controlled and managed so as to correspondingly process the abnormal target in the Java virtual machine in time, so that the Java virtual machine can be effectively managed.

Description

Java virtual machine management method and device
Technical Field
The embodiment of the invention relates to the field of financial technology (Fintech), in particular to a Java virtual machine management method and device.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology, but due to the requirements of the financial industry on safety and real-time performance, higher requirements are also put forward on the technologies.
A virtual machine (virtual machine) refers to a complete computer system that has complete hardware system functions and runs in a completely isolated environment through software simulation, and work that can be completed in a physical computer can be realized in a virtual machine. That is, an environment may be created between the computer platform and the end-user, who operates the software based on the environment created by the software. Based on this feature of the virtual machine, the virtual machine is gradually applied to the field of financial technology to provide more convenient service for the financial enterprise or the customers of the financial enterprise.
With the continuous application of virtual machines, especially in the field of financial technology, in order to ensure the quality of financial services, it is necessary to locate the problem of program abnormality occurring in the virtual machine and manage the memory of the virtual machine. However, at the present stage, for monitoring of the virtual machine, the full-link analysis tool (i.e., Pinpoint) can only acquire process-level monitoring parameters such as cpu usage and heap memory, and display the process-level monitoring parameters, and cannot accurately locate the program exception problem occurring in the virtual machine and effectively manage the virtual machine.
In summary, there is a need for a management method for a Java virtual machine to solve the problem in the prior art that the virtual machine cannot be effectively managed.
Disclosure of Invention
The embodiment of the invention provides a Java virtual machine management method and device, which are used for solving the problem that the virtual machine cannot be effectively managed in the prior art.
In a first aspect, an embodiment of the present invention provides a method for managing a Java virtual machine, including:
acquiring thread level parameter information and process level parameter information in the running process of a Java virtual machine; the thread-level parameter information is acquired after a class method in the Java virtual machine is reconstructed;
analyzing the process level parameter information and the thread level parameter information to determine whether an abnormal target exists in the Java virtual machine;
if yes, sending a control instruction to the Java virtual machine; and the control instruction is used for indicating the Java virtual machine to operate the abnormal target.
In the above technical solution, a new interface (the new interface includes the reconstructed class method) can be obtained by reconstructing the class method in the Java virtual machine, and more comprehensive and more detailed parameter information during the running of the Java virtual machine, that is, thread-level parameter information and process-level parameter information, can be collected from the bottom layer based on the new interface. Based on the method, the parameter information can be analyzed in time to determine whether the abnormal target exists in the Java virtual machine, and when the abnormal target appears in the Java virtual machine, the specific reason of the abnormal target can be more accurately positioned in time. Then, after the specific reason of the abnormal object is determined, the scheme can actively control and manage the Java virtual machine so as to timely and correspondingly process the abnormal object in the Java virtual machine. That is, a control instruction can be actively sent to the Java virtual machine, so as to automatically adjust an abnormal target in the Java virtual machine based on the control instruction, thereby avoiding that the Java application program is suspended and cannot provide normal services, and realizing effective management of the Java virtual machine (for example, effective management of a memory of the Java virtual machine), and further solving the problem that the virtual machine cannot be effectively managed in the prior art.
Optionally, the thread-level parameter information is acquired after reconstructing a class method in the Java virtual machine, and includes:
reconstructing class methods in the Java virtual machine through an expansion interface of the Java virtual machine;
and acquiring thread-level parameter information through an agent component deployed on an application server where the Java virtual machine is located.
In the technical scheme, the class method in the Java virtual machine is reconstructed through the extended interface of the Java virtual machine, so that a new interface can be constructed, and the agent component deployed on the application server can collect thread-level parameter information in the Java virtual machine from the bottom layer in time based on the new interface.
Optionally, the process-level parameter information includes at least one of: the system comprises a program counter, a Java virtual machine stack, a local method stack, a Java heap, a method area, a runtime constant pool and a direct memory; the thread-level parameter information includes at least one of: the resource occupation condition of the thread, the resource occupation condition of the class, the resource occupation condition of the method and the resource occupation condition of the object.
According to the technical scheme, the process-level parameter information and the thread-level parameter information can be collected, so that the parameter information of the Java virtual machine in operation can be displayed in a finer granularity, and the specific reason of the program abnormity can be timely and accurately positioned when the program abnormity occurs in the Java virtual machine based on the parameter information in the finer granularity, so that the program abnormity can be timely and effectively processed, and the condition that the Java application program is suspended and normal service cannot be provided is avoided.
Optionally, the obtaining thread-level parameter information and process-level parameter information in the running of the Java virtual machine includes:
the virtual machine server acquires the thread-level parameter information and the process-level parameter information through a collection component and an agent component of an application server where the Java virtual machine is located;
analyzing the process level parameter information and the thread level parameter information to determine whether an abnormal target exists in the Java virtual machine, including:
the virtual machine server analyzes the process level parameter information and the thread level parameter information through an analysis component to determine whether an abnormal target exists in the Java virtual machine;
sending a control instruction to the Java virtual machine, including:
and the virtual machine server sends a control instruction to the Java virtual machine through the collection component.
In the technical scheme, the thread-level parameter information and the process-level parameter information of the Java virtual machine, which are acquired by the agent component, can be timely acquired by the collecting component, and the information that the agent component has acquired the thread-level parameter information and the process-level parameter information is notified to the analyzing component, so that the analyzing component can timely analyze the process-level parameter information and the thread-level parameter information, and therefore when an abnormal target is determined, a control instruction can be timely and effectively sent to the Java virtual machine, and the abnormal target can be timely and effectively processed.
Optionally, the analyzing the process-level parameter information and the thread-level parameter information to determine whether an abnormal target exists in the Java virtual machine includes:
dividing the process-level parameter information and the thread-level parameter information collected by the collection component into a plurality of data blocks according to the difference of the application servers;
and determining whether an abnormal target exists in each data block or not according to a distributed parallel computing mode.
According to the technical scheme, each data block is processed in a distributed parallel computing mode, whether an abnormal target exists in each data block can be timely and accurately determined, therefore, relevant information of the abnormal target can be timely transmitted to the interface component for warning display, and accurate processing can be timely performed on the abnormal target in the Java virtual machine.
Optionally, the determining whether an exception target exists in each data block in a distributed parallel computing manner includes:
the analysis component calls at least one first working node and at least one second working node through the main node;
for each first working node, reading a local data block and calculating the local data block by the first working node to obtain result data;
after determining that the calculation of each first working node is completed, the master node summarizes result data obtained by the calculation of each first working node into a result file through the at least one second working node; the result file is used for the analysis component to compare each parameter in the result file with the early warning threshold value corresponding to the parameter, and whether the parameter is abnormal or not is determined.
In the technical scheme, each data block is processed in parallel in a distributed parallel computing mode, and processed result data can be timely and accurately obtained, so that data support is provided for determining whether thread-level parameter information and process-level parameter information in the running process of the Java virtual machine have abnormal parameters.
Optionally, the sending, by the virtual machine server, a control instruction to the Java virtual machine through the collection component includes:
establishing a communication channel between the agent component and the Java virtual machine based on a binding mechanism;
the virtual machine server sends the control instruction to the agent component through the collection component; and the agent component is used for sending the control instruction to the Java virtual machine through the communication channel.
In the technical scheme, through the binding mechanism, direct communication between the agent component and the Java virtual machine can be realized, so that the agent component can timely and effectively issue the control instruction to the Java virtual machine after the collection component sends the control instruction to the agent component.
Optionally, the proxy component is configured to send the control instruction to the Java virtual machine through the communication channel, and includes:
the agent component establishes connection with the Java virtual machine by calling a communication thread, and sends the control instruction to an abnormal target in the Java virtual machine after the connection is successfully established;
before sending a control instruction to the Java virtual machine, the method further includes:
and when the virtual machine server monitors that the analysis component stores the processed process level parameter information and the processed thread level parameter information into a database through an interface component, the virtual machine server acquires the processed process level parameter information and the processed thread level parameter information from the database to display the processed process level parameter information and the processed thread level parameter information, and displays the alarm information of the abnormal target.
In the technical scheme, the thread-level parameter information and the process-level parameter information of the Java virtual machine can be visually and clearly displayed and the alarm information of the abnormal target can be displayed through the interface component, so that a user can more visually and clearly know the current state of each parameter.
In a second aspect, an embodiment of the present invention further provides a Java virtual machine management apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring thread-level parameter information and process-level parameter information in the running process of the Java virtual machine; the thread-level parameter information is acquired after a class method in the Java virtual machine is reconstructed;
the processing unit is used for analyzing the process level parameter information and the thread level parameter information and determining whether an abnormal target exists in the Java virtual machine or not; if yes, sending a control instruction to the Java virtual machine; and the control instruction is used for indicating the Java virtual machine to operate the abnormal target.
Optionally, the obtaining unit is specifically configured to:
reconstructing class methods in the Java virtual machine through an expansion interface of the Java virtual machine;
and acquiring thread-level parameter information through an agent component deployed on an application server where the Java virtual machine is located.
Optionally, the obtaining unit is specifically configured to:
the process-level parameter information includes at least one of: the system comprises a program counter, a Java virtual machine stack, a local method stack, a Java heap, a method area, a runtime constant pool and a direct memory; the thread-level parameter information includes at least one of: the resource occupation condition of the thread, the resource occupation condition of the class, the resource occupation condition of the method and the resource occupation condition of the object.
Optionally, the obtaining unit is specifically configured to:
acquiring the thread-level parameter information and the process-level parameter information through a collection component and an agent component of an application server where the Java virtual machine is located;
the processing unit is specifically configured to:
analyzing the process-level parameter information and the thread-level parameter information through an analysis component to determine whether an abnormal target exists in the Java virtual machine;
the processing unit is specifically configured to:
and sending a control instruction to the Java virtual machine through the collection component.
Optionally, the processing unit is specifically configured to:
dividing the process-level parameter information and the thread-level parameter information collected by the collection component into a plurality of data blocks according to the difference of the application servers;
and determining whether an abnormal target exists in each data block or not according to a distributed parallel computing mode.
Optionally, the processing unit is specifically configured to:
calling at least one first working node and at least one second working node through a main node;
for each first working node, reading a local data block and calculating the local data block by the first working node to obtain result data;
after determining that the calculation of each first working node is completed, the master node summarizes result data obtained by the calculation of each first working node into a result file through the at least one second working node; the result file is used for the analysis component to compare each parameter in the result file with the early warning threshold value corresponding to the parameter, and whether the parameter is abnormal or not is determined.
Optionally, the processing unit is specifically configured to:
establishing a communication channel between the agent component and the Java virtual machine based on a binding mechanism;
the virtual machine server sends the control instruction to the agent component through the collection component; and the agent component is used for sending the control instruction to the Java virtual machine through the communication channel.
Optionally, the processing unit is specifically configured to:
establishing connection with the Java virtual machine by calling a communication thread, and sending the control instruction to an abnormal target in the Java virtual machine after the connection is successfully established;
the processing unit is further to:
before sending a control instruction to the Java virtual machine, when an interface component monitors that an analysis component stores processed process level parameter information and thread level parameter information into a database, the process level parameter information and the thread level parameter information are acquired from the database and displayed, and alarm information of the abnormal target is displayed.
In a third aspect, an embodiment of the present invention provides a computing device, including at least one processor and at least one memory, where the memory stores a computer program, and when the program is executed by the processor, the processor is caused to execute the Java virtual machine management method according to any of the first aspects.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program runs on the computing device, the program causes the computing device to execute the Java virtual machine management method according to any of the first aspects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a Java virtual machine management system architecture according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a Java virtual machine management method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of another Java virtual machine management method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a memory area structure of a Java virtual machine according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a Java virtual machine management apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the following, some terms related to the embodiments of the present invention are first explained to facilitate understanding by those skilled in the art.
(1) Jvm: is an abbreviation of Java Virtual Machine, Jvm is a specification for computing devices, which is an imaginary computer implemented by emulating various computer functions on a real computer.
(2) oom: out of memory, meaning that memory is used up, generally causes two situations of memory use up, one is that allocation is less, for example, the virtual machine itself may use too little memory; another situation is that the application is too much used and is not released at all, wasting memory leak or memory overflow.
(3) Memory leak: the memory which is used up by the application is not released, so that the virtual machine cannot use the memory again, and the memory is leaked at the moment, because the applicant is not used and cannot be allocated to other people by the virtual machine.
(4) Memory overflow: the memory requested exceeds the size of memory that Jvm can provide.
(5) And (3) garbage recovery: the garbage collector periodically finds out variables that are no longer used (i.e. variables that end the life cycle, such as local variables) at regular time intervals, and then releases the memory occupied by the variables. For example, when a character string or an object is not needed, the occupied memory needs to be released, otherwise all the available memory in the system is consumed, and the system is crashed.
(6) HBase: is a distributed, column-oriented open source database. Unlike a typical relational database, the HBase is a database suitable for unstructured data storage (i.e., storage based on a column rather than a row-based schema).
(7) JVMTI: the abbreviation is JVM Tool Interface (Java virtual machine Tool Interface), which refers to some Interface set exposed by the Java virtual machine for user to extend.
(8) The flap dump: is a binary file which saves the use condition of the objects in the Java virtual machine heap at a certain moment.
As described above, some terms related to the embodiments of the present invention are described, and the technical features related to the embodiments of the present invention are described below.
To facilitate understanding of the embodiment of the present invention, first, a Java virtual machine management system architecture applicable to the embodiment of the present invention is described by taking the system structure shown in fig. 1 as an example. The Java virtual machine management system architecture can be applied to participate in memory management and the like of the Java virtual machine. As shown in fig. 1, the Java virtual machine management system architecture may include a management service platform 100, at least one virtual machine agent component (such as a virtual machine agent component 201, a virtual machine agent component 202, a virtual machine agent component 203, and the like), and a database 300. Each virtual machine agent component is connected to the management service platform 100, for example, through a wired connection or a wireless connection, which is not limited specifically.
Among other things, the management service platform 100 can include a monitoring presentation component 101, a data collection component 102, and a data analysis component 103.
The monitoring display component 101 is used for displaying monitoring parameters of the Java virtual machine and giving an alarm to abnormal data in the monitoring parameters of the Java virtual machine; meanwhile, the user can perform custom setting of the monitoring parameter threshold value on the monitoring display component (also called as an interface component);
the data collection component 102 is configured to receive a notification message that the monitoring parameters of the Java virtual machine reported by the virtual machine agent component are stored in the database 300, and send the notification message to the data analysis component 103; or, the data collection component (also referred to as a collection component) 102 may also be configured to collect monitoring parameters of the Java virtual machine reported by the virtual machine agent component, and send the collected monitoring parameters of the Java virtual machine to the data analysis component 103 for analysis processing. Meanwhile, the data collection component 102 also receives a control instruction issued by the data analysis component 103 for abnormal information appearing in the Java virtual machine, and issues the control instruction to a corresponding virtual machine agent component;
the data analysis component 103 is configured to, upon receiving a notification message that the monitoring parameters of the Java virtual machine sent by the data collection component 102 are stored in the database 300, read the monitoring parameters of the Java virtual machine from the database 300, and perform analysis processing on the monitoring parameters of the Java virtual machine. If the abnormal data exist in the monitoring parameters of the Java virtual machine, the virtual machine agent component corresponding to the abnormal data is determined, and a control instruction is issued to the corresponding virtual machine agent component through the data collection component 102, wherein the control instruction is used for the virtual machine agent component to correspondingly process an abnormal target related to the abnormal data in the Java virtual machine. For example, for the problem of too high memory occupied by a method in the Java virtual machine, the data analysis component (also referred to as an analysis component) 103 issues a memory release recovery instruction to the data collection component 102, and the data collection component 102 issues the memory release recovery instruction to the corresponding virtual machine agent component, so that the virtual machine agent component performs garbage recovery operation on the memory occupied by the method in the Java virtual machine, and thus, abnormal data can be released and recovered in time, and memory leakage or memory overflow can be avoided. Meanwhile, the data analysis component 103 reports the abnormal data to the monitoring and displaying component 101 through the data collection component, so that the monitoring and displaying component 101 gives an alarm based on the abnormal data.
For each virtual machine agent component, the virtual machine agent component is deployed on the application server, and is configured to collect monitoring parameters of the Java virtual machine in the application server, report the monitoring parameters of the Java virtual machine to the management service platform 100, and store the monitoring parameters of the Java virtual machine in the database 300. In addition, the virtual machine agent component may accept a control instruction issued by the management service platform 100 to manage and control the Java virtual machine, for example, parameters of the Java virtual machine may be adjusted, or an exception thread in the Java virtual machine may be captured, or an exception code in the Java virtual machine may be captured. Specifically, the data analysis component 103 may issue a control instruction for the abnormal information to the data collection component 102 for the abnormal information appearing in the Java virtual machine, and the data collection component 102 issues the control instruction to the corresponding virtual machine agent component, and then the virtual machine agent component issues the control instruction to the corresponding Java virtual machine, so as to correspondingly process the abnormal target related to the abnormal information of the Java virtual machine. It should be noted that the virtual machine agent component may collect monitoring parameters of one or more Java virtual machines in the application server, which is not limited in the embodiment of the present invention.
The database 300, for example, the database 300 may be Hbase, and may be configured to store the monitoring parameters of the Java virtual machine collected by the virtual machine agent component, and may be configured to store the monitoring parameters processed by the data analysis component 103.
It should be noted that the structure shown in fig. 1 is only an example, and the embodiment of the present invention is not limited thereto.
Based on the above description, fig. 2 exemplarily shows a flow of a Java virtual machine management method provided by an embodiment of the present invention, where the flow can be executed by a Java virtual machine management apparatus.
As shown in fig. 2, the process specifically includes:
step 201, obtaining thread level parameter information and process level parameter information in the running of the Java virtual machine.
Step 202, analyzing the process level parameter information and the thread level parameter information, and determining whether an abnormal target exists in the Java virtual machine.
Step 203, if it is determined that an abnormal target exists in the Java virtual machine, sending a control instruction to the Java virtual machine.
In step 201, the agent component of the application server where the Java virtual machine is located may collect the thread level parameter information and the process level parameter information of the Java virtual machine in operation through the interface provided by the Java virtual machine. Specifically, because the scheme in the prior art can only collect process-level monitoring parameters such as cpu usage and heap memory, but cannot collect thread-level monitoring parameters, the scheme can realize the collection of the thread-level monitoring parameters by reconstructing a class method in the Java virtual machine. That is, firstly, the class method in the Java virtual machine is reconstructed through the extended interface of the Java virtual machine, so that a new interface (the new interface includes the reconstructed class method) can be obtained, and then more comprehensive and more detailed parameter information during the running of the Java virtual machine, that is, thread-level parameter information and process-level parameter information, can be collected from the bottom layer through the new interface. The process level parameter information may include a program counter, a Java virtual machine stack, a local method stack, a Java heap, a method region, a runtime constant pool, a direct memory, and the like; the thread-level parameter information may include resource occupation of the thread, resource occupation of the class, resource occupation of the method, resource occupation of the object, and the like. In addition, for obtaining the thread level parameter information and the process level parameter information, an implementation manner of the embodiment of the present invention is: the virtual machine server (i.e. the management service platform) can collect the thread level parameter information and the process level parameter information in the Java virtual machine in time through a collection component and an agent component of an application server where the Java virtual machine is located through a new interface.
Exemplarily, a class method in a Java virtual machine class library is reconstructed through an extended interface of the Java virtual machine, for example, parameters and contents to be acquired are customized for a Tool class method in a class library tools. Therefore, the agent component can acquire the thread-level parameter information and the process-level parameter information in the Java virtual machine through the reconstructed extension interface.
In the above step 202 and step 203, the virtual machine server analyzes the process-level parameter information and the thread-level parameter information by the analysis component, and determines whether an abnormal target exists in the Java virtual machine. Specifically, the process-level parameter information and the thread-level parameter information collected by the collection component are divided into a plurality of data blocks according to different application servers, and whether an abnormal target exists in each data block is determined in a distributed parallel computing mode. Specifically, when determining whether an abnormal target exists in each data block, the specific implementation process is as follows: the analysis component invokes at least one first worker node and at least one second worker node via the master node. And for each first working node, reading the data block of the local or local rack by the first working node and calculating the data block of the local or local rack to obtain result data. And then, after determining that the calculation of each first working node is completed, the master node summarizes the result data obtained by the calculation of each first working node into a result file through at least one second working node. The result file is used for the analysis component to compare each parameter in the result file with the early warning threshold corresponding to the parameter, and whether the parameter is abnormal or not is determined. Therefore, whether an abnormal target exists in each data block can be accurately determined in time by performing parallel processing on each data block according to a distributed parallel computing mode, so that related information of the abnormal target can be timely transmitted to the monitoring display component for warning display, and accurate processing can be timely performed on the abnormal target in the Java virtual machine, so that the condition that a Java application program is hung up and normal service cannot be provided is avoided. If it is determined that no abnormal target exists in any data block, informing the interface component of the processed information of each process level parameter information and each thread level parameter information so that the interface component can display the processed information of each process level parameter and each thread level parameter information in time. If an abnormal target exists in a certain data block, aiming at the abnormal target, firstly determining a proxy component corresponding to the abnormal target, then issuing a control instruction to the corresponding proxy component through a collection component, and then sending the control instruction to the corresponding Java virtual machine in time by the proxy component so as to timely and effectively process the abnormal target. Specifically, based on the binding mechanism, a communication channel between the agent component and the Java virtual machine is established, and the collection component sends a control instruction to the agent component. Based on this, through the binding mechanism, direct communication between the agent component and the Java virtual machine can be realized, so that the agent component can timely and effectively issue the control instruction to the Java virtual machine after the collection component sends the control instruction to the agent component. The agent component is used for sending a control instruction to the Java virtual machine through a communication channel, namely the agent component establishes connection with the Java virtual machine by calling a communication thread (such as thread Attach Operation and thread Attach Lister) and sends the control instruction to an abnormal target in the Java virtual machine after the connection is successfully established; the control instruction is used for instructing the Java virtual machine to operate the abnormal target.
Illustratively, if it is determined that an abnormal target exists in a certain data block, for example, an object occupies a memory abnormally, and the like, it is necessary to determine an agent component corresponding to the abnormal target, establish a communication channel between the agent component and the Java virtual machine based on an attach mechanism, then issue a control instruction to the corresponding agent component through a collection component, and finally send a memory release recovery instruction to the corresponding Java virtual machine in time, so as to perform a release recovery operation on the object in the Java virtual machine in time, thereby avoiding that the Java application program is suspended and cannot provide a normal service.
In addition, after the analysis component processes each process level parameter information and each thread level parameter information, the interface component acquires each processed process level parameter information and each thread level parameter information from the database for displaying when monitoring that the analysis component stores each processed process level parameter information and each thread level parameter information to the database. If the analysis component determines that an abnormal target exists after processing the process level parameter information and the thread level parameter information, the analysis component also sends the related information of the abnormal target to the interface component, so that the interface component can effectively give an alarm to the abnormal target in time based on the related information of the abnormal target and display the alarm information of the abnormal target. Therefore, the thread-level parameter information and the process-level parameter information of the Java virtual machine can be visually and clearly displayed and the alarm information of the abnormal target can be displayed through the interface component, so that a user can more visually and clearly know the current state of each parameter.
Based on this, the following describes, in detail, an implementation process of the Java virtual machine management method in the embodiment of the present invention with reference to fig. 3. Fig. 3 is a schematic flow chart of another Java virtual machine management method according to an embodiment of the present invention.
Step 1: and the virtual machine agent component collects monitoring parameters of the Java virtual machine in the Java application program.
The virtual machine agent component reconstructs class methods in an extended interface of the Java virtual machine (Jvm), and collects monitoring parameters of the Java virtual machine from the bottom layer of the Java application program based on the reconstructed methods. The virtual machine agent component is deployed on the application server, and the information of the Java program (namely the monitoring parameters of the Java virtual machine) running on the application server can be automatically acquired after the virtual machine agent component is started. The Java program information may include parameter configuration information and usage conditions such as a program counter, a Java virtual machine stack, a local method stack, a Java heap, a method region, a runtime constant pool, and a direct memory, as well as memory data occupied by classes, memory data occupied by methods, memory data occupied by objects, memory conditions and amounts consumed by multiple threads, the number of each request, response time, resource consumption, and the like.
Specifically, a virtual machine agent component (Jvmagent) realizes a custom configuration class method by expanding classes and methods in tools and sa-jdi.jar, directly collects monitoring parameters of the Java virtual machine from a bottom layer based on the custom configuration class method, stores the monitoring parameters of the Java virtual machine in a database, and reports the monitoring parameters of the Java virtual machine to a data collection component (Collector).
Illustratively, the virtual machine agent component calls the JVMTI expansion interface to redevelop through method overloading and class inheritance tools.jar and sa-jdi.jar, generates a new method, and can acquire more comprehensive and more detailed monitoring parameters according to the new method, for example, reconstruct the Tool method in sa-jdi.jar to obtain a MyTool method, and can acquire more comprehensive and more detailed monitoring parameters based on the MyTool method without the limitation of Java virtual machine encapsulated tools (such as jstat, jmap and the like) and interfaces. Therefore, the user can directly acquire the data required by the user according to the requirement of the user. Data collected by packaging tools of Java virtual machines such as jstat and jmap are limited, and the requirements of users cannot be met; the JVMTI also provides a number of valuable functions in Java virtual machine memory management, thread control, methods and variable manipulation.
The Java virtual machine monitoring method comprises the steps of obtaining monitoring parameters of a Java virtual machine, wherein tools and sa-jdi.jar are two most main class libraries for monitoring the Java virtual machine, a plurality of methods which can be directly used are arranged in the two class libraries, and the methods are equivalent to another layer of encapsulation for obtaining the monitoring parameters of the Java virtual machine, but the encapsulation is finished only by one-time execution.
In addition, the virtual machine agent component can perform the following monitoring operation on the Java virtual machine in the Java application, namely:
a. by monitoring parameters such as thread memory consumption, class memory occupation, method memory occupation, object memory occupation and the like in the heap dump in real time, whether an object which cannot be recycled by the garbage collector exists is checked. For example, there are dead loops that create new objects and consume memory resources; and (5) normally consuming too high resources and capturing the code to be optimized.
b. Monitoring a Java virtual machine stack and a local method stack to obtain a thread use condition, a thread memory consumption condition and the like, determining whether the stack depth of a thread request is greater than the maximum depth allowed by the Java virtual machine, and determining whether the memory can be normally applied according to the dynamic expansion size of the stack memory of the Java virtual machine.
c. The method area and the run-time constant pool are monitored to determine whether a large number of classes fill the method area, and the like.
d. And monitoring the direct memory of the computer and the call condition of the program DirectBlueBuffer (out-of-heap memory) class.
Step 2: and the data analysis component analyzes and processes the monitoring parameters of the Java virtual machine and determines whether abnormal data exist in the monitoring parameters.
Specifically, the virtual machine agent component reports a notification message that the monitoring parameters of the Java virtual machine have been stored in the database to the data collection component, and then the data collection component sends the notification message to the data analysis component (Analyzer), so that the data analysis component can analyze and process the monitoring parameters of the Java virtual machine in time. The data analysis component acquires the monitoring parameters of each Java virtual machine from the database, analyzes the monitoring parameters of each Java virtual machine, determines whether abnormal data exists in the monitoring parameters or not, determines a virtual machine agent component corresponding to the abnormal data if the abnormal data exists in the monitoring parameters, and sends a control instruction to the corresponding virtual machine agent component through the data collection component. And then, the virtual machine agent component issues a control instruction to the Java virtual machine so as to correspondingly process an abnormal target associated with abnormal data in the Java virtual machine. For example, when the data analysis component determines that the abnormal data corresponds to an abnormal object or an abnormal thread, before oom appears in the program, the data collection component issues an interrupt instruction to the corresponding virtual machine agent component, and then the virtual machine agent component issues an interrupt instruction to the corresponding Java virtual machine, so as to interrupt the abnormal object or the abnormal thread in the Java virtual machine. Or, when determining that the class occupied memory data exceeds the early warning threshold of the class occupied memory, the data analysis component issues a memory release recovery instruction to the virtual machine proxy component corresponding to the class occupied memory data, and then the virtual machine proxy component issues a memory release recovery instruction to the corresponding Java virtual machine so as to release and recover the class occupied memory in the Java virtual machine. Meanwhile, the Java application program can be prevented from being suspended to influence normal business transactions (such as financial loan transactions, financial transfer transactions or financial payment transactions and the like). In addition, the data analysis component also sends the abnormal information to the monitoring display component through the data collection component, so that the monitoring display component gives an alarm based on the abnormal data in the abnormal information, for example, a user can directly see abnormal stack consumption and abnormal codes in the monitoring display component, and compared with a full link analysis tool in the prior art, the monitoring parameter with finer granularity is displayed more intuitively and clearly.
It should be noted that the data collection component may also be configured to collect monitoring parameters of the Java virtual machine reported by the virtual machine agent component, and send the monitoring parameters of the Java virtual machine to the data analysis component for analysis processing. The data collection component may send the collected monitoring parameters of the Java virtual machine to the data analysis component in real time for analysis, or may send the collected monitoring parameters of the Java virtual machine to the data analysis component for analysis according to a set period (for example, every 30 seconds, every 1 minute, or every 3 minutes, etc.), which is not limited in the embodiment of the present invention.
Further, the data analysis component reads the monitoring parameters of each Java virtual machine from the database, analyzes and processes the monitoring parameters of each Java virtual machine, and determines whether abnormal data exist in the monitoring parameters of each Java virtual machine. Specifically, for any Java virtual machine, comparing each data in the monitoring parameters of the Java virtual machine with the early warning threshold corresponding to the data, and determining whether the data is abnormal. Specifically, MapReduce can be calculated through distributed parallel computing, the acquired monitoring parameters can be firstly split into data blocks, and then the data blocks are compared with corresponding early warning thresholds respectively to determine abnormal information. And then summarizing and outputting the abnormal information. The specific implementation process for determining the abnormal information through the distributed parallel computing MapReduce can be as follows:
a. and the data analysis component reads the monitoring parameters of each Java virtual machine from the database and classifies the monitoring parameters of each Java virtual machine into the corresponding application server according to the type of the application server. And for each application server, dividing the monitoring parameters corresponding to the application server into a plurality of data blocks, and determining the user operation programs corresponding to the data blocks. For example, for an application server, assuming that there are 20 monitoring parameters corresponding to the application server, every 5 parameters may be grouped into 4 groups, and the 4 groups are equivalent to 4 data blocks. Each data block corresponds to a calculation task, and the data analysis component automatically schedules the calculation nodes to process the corresponding data blocks, namely, the data analysis component is mainly responsible for allocating and scheduling the calculation nodes (Map nodes or Reduce nodes), monitoring the execution states of the nodes and controlling the synchronization executed by the Map nodes. For example, parameters such as the class Loaded number, the complex number, S1C, and OC on the 192.168.1.11 server are analyzed and processed, and the parameters are compared with the corresponding set early warning threshold value to determine whether there is an abnormal parameter in the parameters.
b. The data analysis component starts a Master node (Master) responsible for scheduling and data Worker nodes (Worker), i.e., Map nodes and Reduce nodes. The main node searches and prepares an available Map node for the operation program and transmits the program to the Map node; and meanwhile, available Reduce nodes are searched and equipped for the operation program, and the program is transmitted to the Reduce nodes.
c. The main node starts each Map node to execute programs, and each Map node reads data of a local or local rack as much as possible to calculate. In order to reduce data communication, a basic principle is localized data processing, that is, a computing node processes data stored in a local disk as much as possible, so that migration of code to data can be realized. If such localized data processing is not possible, other available nodes are sought and the data is transmitted to the node over the network (i.e., the data migrates to code), but the available nodes are sought from the local chassis in which the data resides as much as possible to reduce communication delays.
d. Each Map node processes the read data block, does some data sorting work, such as combining (grouping), grouping (sorting) and the like, and stores the data on a local machine; and simultaneously informing the main node of the information that the calculation task is completed and informing the main node of the storage position of the intermediate result data after the data block is processed. Wherein the intermediate result data may include exception information.
e. And after the calculation of all Map nodes such as the main node and the like is completed, starting the Reduce node to run. The Reduce node remotely reads the data through the storage position information of the intermediate result data grasped by the main node, summarizes and outputs the data to a result file, and then the whole processing result can be obtained. The entire processing result is then stored in a database.
The data analysis component determines a virtual machine agent component corresponding to any abnormal information in the whole processing result, and issues a control instruction to the data collection component based on the abnormal information, and then the data collection component issues the control instruction to the corresponding virtual machine agent component after receiving the control instruction, so that the virtual machine agent component controls and processes an abnormal target related to the abnormal information in the Java virtual machine. Meanwhile, the data analysis component also transmits the abnormal information to the data collection component, and then the data collection component transmits the abnormal information to the monitoring display component, so that the monitoring display component can give an alarm for the abnormal information.
It should be noted that, in order to implement communication between the virtual machine agent component and the Java virtual machine, in the embodiment of the present invention, the Java application is dynamically managed and controlled by invoking the jvm ti interface and newly developing an extended new interface and by using an attach mechanism of the Java virtual machine. For example, dynamic management is performed on operations such as heap memory leakage control, abnormal object destruction, memory recovery and the like, so that abnormal suspension of the Java application program can be avoided, and the influence on the availability of the business application system can be avoided. Meanwhile, the processing result aiming at the abnormal information is fed back to the data collection assembly, and the data collection assembly is fed back to the monitoring display assembly, so that the monitoring display assembly can display the processing result of the abnormal information, and a user can timely know the processing state of the abnormal information.
The communication implementation process of the virtual machine agent component and the Java virtual machine is described below with reference to fig. 4. Fig. 4 is a schematic diagram of a memory area structure of a Java virtual machine according to an embodiment of the present invention.
a. The data collection component issues control instructions to the virtual machine agent component. For example, the issued control instruction may be a class occupied memory release/recovery instruction, a method occupied memory release/recovery instruction, a thread consumed memory release/recovery instruction, or an abnormal thread interrupt instruction.
b. And calling an Agent _ OnAttach function in a JVM (Java virtual machine interface) by the virtual machine Agent component, starting an attach thread, and realizing direct communication between the virtual machine Agent component and the Java virtual machine.
c. The virtual machine agent component starts two communication threads of the Attach Operation and the Attach Listener, and is connected (Attach) to the corresponding Java virtual machine through the thread Attach Operation and the thread Attach Listener. Then, after connecting with the Java virtual machine, the virtual machine proxy component may send a control instruction to the exception target in the Java virtual machine, so as to process the exception target in the Java virtual machine. For example, for an exception thread, an interrupt instruction may be sent to the corresponding Java virtual machine so as to perform interrupt processing on the exception thread in the Java virtual machine, or for an excessively high class occupied memory, a memory release recovery instruction may be sent to the corresponding Java virtual machine so as to perform release recovery processing on the class occupied memory in the Java virtual machine.
Step 3: and the monitoring display component displays the monitoring parameters processed by the data analysis component.
Specifically, when monitoring that the data analysis component processes the monitoring parameters of the Java virtual machine and stores the monitoring parameters in the database, the monitoring display component (WebUI) may obtain the processed monitoring parameters from the database and display the processed monitoring parameters, so that a user may visually see the use conditions (such as classes, methods, the memory occupied by objects, or the CPU use conditions) of the current Java virtual machine. For example, the monitoring display component may monitor the processing result of the data analysis component in real time, or may monitor the processing result of the data analysis component according to a set period (for example, every 30 seconds, every 1 minute, or every 2 minutes, etc.), which is not limited in the embodiment of the present invention.
Illustratively, after receiving the monitoring parameters of a certain Java virtual machine, the data collection component simply classifies the monitoring parameters of the Java virtual machine, and transmits the monitoring parameters after the simple classification to the monitoring display component. Then, the monitoring display component displays the monitoring parameters, and a user can visually and clearly view the current use condition, the application performance bottleneck, abnormal data alarm and the like of the Java virtual machine in the Java application program through the monitoring display component. Therefore, the problem analysis of daily production can be facilitated, so that a user can actively prevent the problem, meanwhile, the display of monitoring parameters with finer granularity can be facilitated, the actual requirements of the user can be met better, the user can more accurately determine the specific reasons of the program abnormity in the Java application program based on the monitoring parameters with finer granularity, and determine the optimization strategy based on the specific reasons of the program abnormity, for example, the configuration of the Java virtual machine is optimized or the program code is optimized and the like.
The user may also configure the early warning threshold of each data of the monitoring parameters in the monitoring display component, for example, configure early warning thresholds such as heap (heap), maxmeaspace size (maximum value of metaspace memory), MaxdirectMemorySiez (maximum value of off-heap memory), and the like. If certain data exceeds the early warning threshold value, the Java virtual machine management system gives an alarm based on the data and automatically analyzes the specific reason of the data abnormity so as to determine the information such as objects and code blocks consuming the memory.
The above embodiment shows that a new interface (including a reconstructed class method) can be obtained by reconstructing the class method in the Java virtual machine, and more comprehensive and more detailed parameter information during the running of the Java virtual machine, that is, thread-level parameter information and process-level parameter information, can be collected from the bottom layer based on the new interface. Based on the method, the parameter information can be analyzed in time to determine whether the abnormal target exists in the Java virtual machine, and when the abnormal target appears in the Java virtual machine, the specific reason of the abnormal target can be more accurately positioned in time. Then, after the specific reason of the abnormal object is determined, the scheme can actively control and manage the Java virtual machine so as to timely and correspondingly process the abnormal object in the Java virtual machine. That is, a control instruction can be actively sent to the Java virtual machine, so as to automatically adjust an abnormal target in the Java virtual machine based on the control instruction, thereby avoiding that the Java application program is suspended and cannot provide normal services, and realizing effective management of the Java virtual machine (for example, effective management of a memory of the Java virtual machine), and further solving the problem that the virtual machine cannot be effectively managed in the prior art.
Based on the same technical concept, fig. 5 exemplarily shows a Java virtual machine management apparatus that can execute a flow of a Java virtual machine management method according to an embodiment of the present invention.
As shown in fig. 5, the apparatus includes:
an obtaining unit 501, configured to obtain thread-level parameter information and process-level parameter information in the running of a Java virtual machine; the thread-level parameter information is acquired after a class method in the Java virtual machine is reconstructed;
a processing unit 502, configured to analyze the process-level parameter information and the thread-level parameter information, and determine whether an abnormal target exists in the Java virtual machine; if yes, sending a control instruction to the Java virtual machine; and the control instruction is used for indicating the Java virtual machine to operate the abnormal target.
Optionally, the obtaining unit 501 is specifically configured to:
reconstructing class methods in the Java virtual machine through an expansion interface of the Java virtual machine;
and acquiring thread-level parameter information through an agent component deployed on an application server where the Java virtual machine is located.
Optionally, the obtaining unit 501 is specifically configured to:
the process-level parameter information includes at least one of: the system comprises a program counter, a Java virtual machine stack, a local method stack, a Java heap, a method area, a runtime constant pool and a direct memory; the thread-level parameter information includes at least one of: the resource occupation condition of the thread, the resource occupation condition of the class, the resource occupation condition of the method and the resource occupation condition of the object.
Optionally, the obtaining unit 501 is specifically configured to:
acquiring the thread-level parameter information and the process-level parameter information through a collection component and an agent component of an application server where the Java virtual machine is located;
the processing unit 502 is specifically configured to:
analyzing the process-level parameter information and the thread-level parameter information through an analysis component to determine whether an abnormal target exists in the Java virtual machine;
the processing unit 502 is specifically configured to:
and sending a control instruction to the Java virtual machine through the collection component.
Optionally, the processing unit 502 is specifically configured to:
dividing the process-level parameter information and the thread-level parameter information collected by the collection component into a plurality of data blocks according to the difference of the application servers;
and determining whether an abnormal target exists in each data block or not according to a distributed parallel computing mode.
Optionally, the processing unit 502 is specifically configured to:
calling at least one first working node and at least one second working node through a main node;
for each first working node, reading a local data block and calculating the local data block by the first working node to obtain result data;
after determining that the calculation of each first working node is completed, the master node summarizes result data obtained by the calculation of each first working node into a result file through the at least one second working node; the result file is used for the analysis component to compare each parameter in the result file with the early warning threshold value corresponding to the parameter, and whether the parameter is abnormal or not is determined.
Optionally, the processing unit 502 is specifically configured to:
establishing a communication channel between the agent component and the Java virtual machine based on a binding mechanism;
the virtual machine server sends the control instruction to the agent component through the collection component; and the agent component is used for sending the control instruction to the Java virtual machine through the communication channel.
Optionally, the processing unit 502 is specifically configured to:
establishing connection with the Java virtual machine by calling a communication thread, and sending the control instruction to an abnormal target in the Java virtual machine after the connection is successfully established;
the processing unit 502 is further configured to:
before sending a control instruction to the Java virtual machine, when an interface component monitors that an analysis component stores processed process level parameter information and thread level parameter information into a database, the process level parameter information and the thread level parameter information are acquired from the database and displayed, and alarm information of the abnormal target is displayed.
Based on the same technical concept, an embodiment of the present invention further provides a computing device, as shown in fig. 6, including at least one processor 601 and a memory 602 connected to the at least one processor, where a specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present invention, and the processor 601 and the memory 602 are connected through a bus in fig. 6 as an example. The bus may be divided into an address bus, a data bus, a control bus, etc.
In the embodiment of the present invention, the memory 602 stores instructions executable by the at least one processor 601, and the at least one processor 601 may execute the steps included in the foregoing Java virtual machine management method by executing the instructions stored in the memory 602.
The processor 601 is a control center of the computing device, and may connect various parts of the computing device by using various interfaces and lines, and implement data processing by executing or executing instructions stored in the memory 602 and calling data stored in the memory 602. Optionally, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application program, and the like, and the modem processor mainly processes an issued instruction. It will be appreciated that the modem processor described above may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 601 may be a general-purpose processor, such as a Central Processing Unit (CPU), a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof, configured to implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in connection with the embodiment of the management method for the Java virtual machine may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
The memory 602, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 602 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 602 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 602 in the embodiments of the present invention may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
Based on the same technical concept, embodiments of the present invention further provide a computer-readable storage medium storing a computer program executable by a computing device, wherein when the program runs on the computing device, the computer program causes the computing device to execute the steps of the Java virtual machine management method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present application and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A Java virtual machine management method is characterized by comprising the following steps:
acquiring thread level parameter information and process level parameter information in the running process of a Java virtual machine; the thread-level parameter information is acquired after a class method in the Java virtual machine is reconstructed;
analyzing the process level parameter information and the thread level parameter information to determine whether an abnormal target exists in the Java virtual machine;
if yes, sending a control instruction to the Java virtual machine; and the control instruction is used for indicating the Java virtual machine to operate the abnormal target.
2. The method of claim 1, wherein the thread-level parameter information is collected by reconstructing class methods in the Java virtual machine, comprising:
reconstructing class methods in the Java virtual machine through an expansion interface of the Java virtual machine;
and acquiring thread-level parameter information through an agent component deployed on an application server where the Java virtual machine is located.
3. The method of any of claims 1 to 2, wherein obtaining thread-level parameter information and process-level parameter information in the running of the Java virtual machine comprises:
the virtual machine server acquires the thread-level parameter information and the process-level parameter information through a collection component and an agent component of an application server where the Java virtual machine is located;
analyzing the process level parameter information and the thread level parameter information to determine whether an abnormal target exists in the Java virtual machine, including:
the virtual machine server analyzes the process level parameter information and the thread level parameter information through an analysis component to determine whether an abnormal target exists in the Java virtual machine;
sending a control instruction to the Java virtual machine, including:
and the virtual machine server sends a control instruction to the Java virtual machine through the collection component.
4. The method of claim 3, wherein said analyzing the process-level parameter information and the thread-level parameter information to determine whether an exception target exists in the Java virtual machine comprises:
dividing the process-level parameter information and the thread-level parameter information collected by the collection component into a plurality of data blocks according to the difference of the application servers;
and determining whether an abnormal target exists in each data block or not according to a distributed parallel computing mode.
5. The method of claim 4, wherein determining whether an anomalous target exists in each block of data in a distributed parallel computing manner comprises:
the analysis component calls at least one first working node and at least one second working node through the main node;
for each first working node, reading a local data block and calculating the local data block by the first working node to obtain result data;
after determining that the calculation of each first working node is completed, the master node summarizes result data obtained by the calculation of each first working node into a result file through the at least one second working node; the result file is used for the analysis component to compare each parameter in the result file with the early warning threshold value corresponding to the parameter, and whether the parameter is abnormal or not is determined.
6. The method of claim 3, wherein the virtual machine server sending control instructions to the Java virtual machine through the collection component comprises:
establishing a communication channel between the agent component and the Java virtual machine based on a binding mechanism;
the virtual machine server sends the control instruction to the agent component through the collection component; and the agent component is used for sending the control instruction to the Java virtual machine through the communication channel.
7. The method of claim 6, wherein the proxy component is configured to send the control instructions to the Java virtual machine over the communication channel, comprising:
the agent component establishes connection with the Java virtual machine by calling a communication thread, and sends the control instruction to an abnormal target in the Java virtual machine after the connection is successfully established;
before sending a control instruction to the Java virtual machine, the method further includes:
and when the virtual machine server monitors that the analysis component stores the processed process level parameter information and the processed thread level parameter information into a database through an interface component, the virtual machine server acquires the processed process level parameter information and the processed thread level parameter information from the database to display the processed process level parameter information and the processed thread level parameter information, and displays the alarm information of the abnormal target.
8. A Java virtual machine management apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring thread-level parameter information and process-level parameter information in the running process of the Java virtual machine; the thread-level parameter information is acquired after a class method in the Java virtual machine is reconstructed;
the processing unit is used for analyzing the process level parameter information and the thread level parameter information and determining whether an abnormal target exists in the Java virtual machine or not; if yes, sending a control instruction to the Java virtual machine; and the control instruction is used for indicating the Java virtual machine to operate the abnormal target.
9. A computing device comprising at least one processor and at least one memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the method of any of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program executable by a computing device, the program, when run on the computing device, causing the computing device to perform the method of any of claims 1 to 7.
CN202110555495.4A 2021-05-21 2021-05-21 Java virtual machine management method and device Pending CN113157401A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110555495.4A CN113157401A (en) 2021-05-21 2021-05-21 Java virtual machine management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110555495.4A CN113157401A (en) 2021-05-21 2021-05-21 Java virtual machine management method and device

Publications (1)

Publication Number Publication Date
CN113157401A true CN113157401A (en) 2021-07-23

Family

ID=76876892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110555495.4A Pending CN113157401A (en) 2021-05-21 2021-05-21 Java virtual machine management method and device

Country Status (1)

Country Link
CN (1) CN113157401A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672390A (en) * 2021-08-23 2021-11-19 杭州安恒信息技术股份有限公司 Server memory recovery method, device and equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672390A (en) * 2021-08-23 2021-11-19 杭州安恒信息技术股份有限公司 Server memory recovery method, device and equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN111049705B (en) Method and device for monitoring distributed storage system
CN108845884B (en) Physical resource allocation method, device, computer equipment and storage medium
CN104780146B (en) Method for managing resource and device
CN111399986A (en) Method and device for configuring Pod resource quota
CN109783157B (en) Method and related device for loading algorithm program
CN105049268A (en) Distributed computing resource allocation system and task processing method
CN108153587B (en) Slow task reason detection method for big data platform
CN111209110B (en) Task scheduling management method, system and storage medium for realizing load balancing
GB2508161A (en) Monitoring applications executing on a virtual machine and allocating the required resources to the virtual machine.
CN113312153B (en) Cluster deployment method and device, electronic equipment and storage medium
CN115373835A (en) Task resource adjusting method and device for Flink cluster and electronic equipment
CN112199192B (en) Method and system for deploying Kubernetes cluster refined management quota based on server
CN111754123A (en) Data monitoring method and device, computer equipment and storage medium
TW201805889A (en) Flow velocity control method and device
CN113157401A (en) Java virtual machine management method and device
CN109992408B (en) Resource allocation method, device, electronic equipment and storage medium
CN114327963A (en) Anomaly detection method and device
CN113127314B (en) Method and device for detecting program performance bottleneck and computer equipment
CN112559565A (en) Abnormity detection method, system and device
CN115480924A (en) Method and device for processing job data, storage medium and electronic equipment
Willnecker et al. Model-based prediction of automatic memory management and garbage collection behavior
US7681198B2 (en) Workload categorization for detecting role changes in a host computing device
CN112035322A (en) JVM monitoring method and device
CN113282565A (en) Data access method, device, scheduling equipment and storage medium
CN103970854A (en) Method for synchronizing incremental certificate information between SAP ECC end and SAP BW end

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination