Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A non-invasive JVM thread stack collection method and device

A process stack and thread technology, applied in the field of non-invasive JVM thread stack collection, can solve problems such as potential safety hazards, missing the best time to obtain information, and not allowing private opening of process interfaces, so as to reduce the threshold of use and reduce the risk of operation and maintenance , The effect of lowering the collection threshold

Active Publication Date: 2019-05-07
GUANGDONG ESHORE TECH
View PDF10 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This method is fine when the application scale and server data are not much, but if it is a large-scale distributed complex application with a large number of servers, and the current popular docker deployment mode is adopted, it is necessary to find the target server and log in. A troublesome thing; In addition, in large-scale applications, server deployment security is strictly controlled, and ordinary developers do not have the authority to log in to the server. If they want to obtain JVM thread stack information, they can only apply to the operation and maintenance personnel for operation, and often miss the acquisition. best time for information
[0004] Another way to obtain JVM thread stack information is to use the ManagementFactory.getThreadMXBean() interface method provided by JDK to collect, but this method requires developers to write code in advance and expose the interface to achieve collection, such as opening the JMX interface; and Open interfaces also have potential security risks. Many large-scale applications are not allowed to open process interfaces privately; in addition, to find the IP and port corresponding to the target process to call, there is also the problem of logging in to the target server in the first method, that is, how to determine under a large number of application processes. Destination IP and port

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A non-invasive JVM thread stack collection method and device
  • A non-invasive JVM thread stack collection method and device
  • A non-invasive JVM thread stack collection method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] In a specific embodiment, the method also includes,

[0050] After the connection channel is established, the connection channel is kept valid through the heartbeat mechanism.

[0051] In this embodiment, the connection channel between the JVM process and the registration center is maintained valid through a cyclic heartbeat.

Embodiment 2

[0053] In a specific embodiment, the initialization of the Agent package further includes loading a JVM thread stack collection interface.

[0054] Further, according to the request for obtaining the thread stack, reading the thread stack information and returning it to the client specifically includes,

[0055]According to the request to obtain the thread stack, call the local method through the JVM thread stack collection interface, read the thread stack information and return it to the client.

[0056] In this embodiment, the local method is called, the thread stack information is obtained through the JVM thread stack collection interface, and the thread stack information is returned to the client, so that the user can obtain the thread stack information in time.

[0057] A device for non-intrusive JVM thread stack collection, comprising:

[0058] The Agent package loading module is used to load the Agent package by setting the javaAgent parameter when the client deploys t...

Embodiment 3

[0065] In a specific embodiment, the device further includes a heartbeat maintaining module, configured to maintain the connection channel valid through a heartbeat mechanism after the connection channel is established.

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a non-invasive JVM thread stack collection method and device, and the method comprises the steps: enabling a user side to load an Agent package through setting java Agent parameters when deploying an application; Initializing an Agent packet to establish a connection channel between the JVM process and the registration center, and generating a channel ID and channel establishment time; Storing the channel ID and the channel establishment time in a channel cache; Sending a request for inquiring a JVM thread stack to a registration center, wherein the request comprises a JVM process name; According to the JVM process name, obtaining a corresponding channel ID from a channel cache, and sending a request for obtaining thread stack information to a target JVM process; Andreading the thread stack information and returning the thread stack information to the user side according to the request for obtaining the thread stack. The method has the technical effects that a non-invasive mode technology is provided for JVM thread stack collection through a javaAgent mechanism of the JVM, the target JVM process is quickly positioned through linkage with a registration center, a target server does not need to be logged in, and the collection threshold and the operation and maintenance risk are reduced.

Description

technical field [0001] The invention relates to a method and device for collecting JVM thread stacks, in particular to a method and device for non-invasive JVM thread stack collection. Background technique [0002] As the large-scale application systems developed by Java become larger and more complex, many systems are integrated together, and the whole system looks like a black box. When the system runs abnormally, viewing and printing the JVM thread stack can help developers or operation and maintenance personnel quickly analyze performance bottlenecks and find the root cause of the problem. [0003] Generally, when printing JVM thread stack information, you need to log in to the target server first, and then call the jstack tool provided by JDK to print. This method is fine when the application scale and server data are not much, but if it is a large-scale distributed complex application with a large number of servers, and the current popular docker deployment mode is ad...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/30
Inventor 王沛文周宏江詹先
Owner GUANGDONG ESHORE TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products