Process monitoring method and device, equipment and storage medium
By displaying the process list in the process monitoring method and device and automatically monitoring the resource usage of the target process in response to user requests, the problem of low monitoring efficiency in the prior art is solved, and more efficient resource usage analysis and positioning is achieved.
Patent Information
- Application Number
- CN202510278169.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-06-20
AI Technical Summary
In the prior art, using debugging tools to monitor process resource usage is less efficient, and requires command-line operations to affect analysis efficiency.
Provides a process monitoring method and device, by displaying a process list, automatically starts the target process in response to user monitoring requests, and monitors its resource data, and outputs resource usage information, including resource fluctuation information and resource snapshot information.
It improves the efficiency of monitoring process resource usage, allowing users to obtain intuitive resource usage information through simple operations, and quickly analyze and locate resource usage abnormal problems.
Smart Images

Figure CN120179503A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to process monitoring technologies, and in particular, to a process monitoring method, apparatus, device, and storage medium. Background Art
[0002] During the running of a program process, it is necessary to monitor the resource usage of the process to determine whether there are abnormal problems in the resource usage of the process. For example, it is necessary to monitor whether there are memory leaks, handle leaks, etc.
[0003] In the related art, relevant debugging tools can be used to monitor whether there are problems such as memory leaks and handle leaks during the running of a process. When using relevant debugging tools to monitor a target process, specific commands need to be used and the process name of the target process needs to be input to trigger the monitoring of the target process. The method of monitoring through command-line operations has low efficiency and affects the analysis efficiency of the resource usage of the process. Summary of the Invention
[0004] Embodiments of the present disclosure provide a process monitoring method, apparatus, device, and storage medium to solve the above problems to a certain extent.
[0005] In one aspect of the embodiments of the present disclosure, a process monitoring method is provided, including:
[0006] Displaying a process list, where the process list includes at least one created process;
[0007] In response to a monitoring request for a target process in the process list, starting the target process and monitoring resource data used by the target process to obtain resource monitoring information;
[0008] Outputting resource usage information corresponding to the target process based on the resource monitoring information, where the resource usage information includes at least one of resource fluctuation information and resource snapshot information. The resource fluctuation information is used to characterize the fluctuation state of the resource usage amount of the target process during the monitoring time period, and the resource snapshot information is used to characterize the resource usage situation of the target process at a specific moment.
[0009] In another aspect of the embodiments of the present disclosure, a process monitoring apparatus is provided, including:
[0010] A process display module, configured to display a process list, where the process list includes at least one created process;
[0011] A process monitoring module, configured to start the target process and monitor resource data used by the target process in response to a monitoring request for the target process in the process list to obtain resource monitoring information;
[0012] An information output module, configured to output resource usage information corresponding to the target process based on the resource monitoring information, where the resource usage information includes at least one of resource fluctuation information and resource snapshot information, the resource fluctuation information is used to characterize the fluctuation state of the resource usage amount of the target process during the monitoring time period, and the resource snapshot information is used to characterize the resource usage situation of the target process at a specific moment.
[0013] In another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the process monitoring method described in any one of the above embodiments is implemented.
[0014] In another aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program. When the computer program is executed by a processor, the process monitoring method described in any one of the above embodiments is implemented.
[0015] In the embodiments of the present disclosure, for the currently created processes, a corresponding process list is displayed. When the user has a monitoring requirement for a target process, a monitoring request for the target process can be triggered through the process list. After receiving the monitoring request for the target process, the corresponding target process is automatically started, and the resource data used by the target process is monitored to obtain resource monitoring information. Thus, the resource usage information corresponding to the target process can be output according to the monitored resource monitoring information, enabling the user to know the resource usage situation of the target process, which is simple to operate and helps improve the efficiency of monitoring different processes. In addition, the resource usage information includes at least one of resource fluctuation information and resource snapshot information. The resource fluctuation information enables the user to understand the fluctuation state of the resource usage amount of the target process during the monitoring time period, and the resource snapshot information enables the user to understand the resource usage situation of the target process at a specific moment. Thus, it is possible to analyze whether there is an abnormality in the resource usage situation of the target process based on at least one of the fluctuation state of the resource usage amount during the monitoring time period and the resource usage situation at a specific moment, which helps improve the efficiency of analyzing and locating abnormal problems in the resource usage of the target process.
[0016] The technical solutions of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings forming a part of the specification depict embodiments of the present disclosure and, together with the description, are used to explain the principles of the present disclosure.
[0018] Referring to the accompanying drawings, the present disclosure can be more clearly understood from the following detailed description, where:
[0019] Figure 1 is a flowchart of a process monitoring method provided by an exemplary embodiment of the present disclosure;
[0020] Figure 2 It is a flowchart of a process monitoring method provided by another exemplary embodiment of the present disclosure;
[0021] Figure 3 It is a schematic diagram of an interface in the full-process display mode provided by an exemplary embodiment of the present disclosure;
[0022] Figure 4 It is a schematic diagram of an interface in the single-process display mode provided by an exemplary embodiment of the present disclosure;
[0023] Figure 5 It is a flowchart of a process monitoring method provided by yet another exemplary embodiment of the present disclosure;
[0024] Figure 6 It is a schematic diagram of an interface of a snapshot analysis window provided by an exemplary embodiment of the present disclosure;
[0025] Figure 7 It is a flowchart of a process monitoring method provided by another exemplary embodiment of the present disclosure;
[0026] Figure 8 It is a schematic diagram of the structure of a process monitoring device provided by an exemplary embodiment of the present disclosure;
[0027] Figure 9 It is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present disclosure. Detailed implementation manners
[0028] Now, various exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. It should be noted that: Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions, and values set forth in these embodiments do not limit the scope of the present disclosure.
[0029] Those skilled in the art can understand that terms such as "first", "second", etc. in the embodiments of the present disclosure are only used to distinguish different steps, devices, or modules, etc., and neither represent any specific technical meaning nor indicate an inevitable logical order between them.
[0030] It should also be understood that in the embodiments of the present disclosure, "a plurality" may refer to two or more, and "at least one" may refer to one, two, or more.
[0031] It should also be understood that for any component, data, or structure mentioned in the embodiments of the present disclosure, unless specifically defined or otherwise indicated by the context, it is generally understood to be one or more.
[0032] In addition, the term "and / or" in the present disclosure is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three cases: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present disclosure generally represents an "or" relationship between the front and back associated objects.
[0033] It should also be understood that the description of each embodiment in the present disclosure emphasizes the differences between the embodiments, and the same or similar parts can be referred to each other. For the sake of brevity, they will not be elaborated one by one.
[0034] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0035] The following description of at least one exemplary embodiment is actually merely illustrative and in no way a limitation on the present disclosure or its application or use.
[0036] Techniques, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be regarded as part of the specification.
[0037] It should be noted that like reference numerals and letters denote like items in the following figures, and thus, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0038] Embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.
[0039] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, target programs, components, logics, data structures, etc., which perform specific tasks or implement specific abstract data types. The computer system / server can be implemented in a distributed cloud computing environment where tasks are executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0040] Memory leak refers to the situation where after a program allocates memory, it fails to release it in a timely manner, resulting in the memory being occupied for a long time and unable to be recycled. Memory leaks can cause the available memory of the system to gradually decrease, leading to the program being unable to run properly or the system crashing. Handle leak refers to the situation where after calling system files or other resources, the opened file handles or other resources are not correctly released, causing the opened file handles or other resources to continuously occupy system space until the program terminates and they are released. Handle leak is one of the common causes of system resource exhaustion and performance problems. Troubleshooting handle leaks usually requires combining multiple tools and methods.
[0041] Memory leaks and handle leaks cannot be detected and warned in advance through analysis during the compilation process because the code is static while the program is dynamic. Even for the same piece of code, due to different execution flows, it may result in either leakage or no leakage. Currently, debugging tools are usually used to detect memory leaks and handle leaks, but their command-line operations and displays are not intuitive, and each detection requires starting or attaching to the target process, resulting in low detection efficiency.
[0042] In the embodiments of the present disclosure, according to the monitoring request for the target process, the target process can be automatically started and the resource data used by the target process can be automatically monitored, so as to output the resource usage information corresponding to the target process, enabling the user to obtain intuitive resource usage information through simple operations, know the resource usage situation of the target process, and thus help improve the efficiency of analyzing and locating abnormal problems in the resource usage of the target process (such as memory leaks, handle leaks, etc.).
[0043] As Figure 1 shown, it shows a flowchart of a process monitoring method provided by an exemplary embodiment of the present disclosure. This method can be used for the above-mentioned electronic devices, and the method includes the following steps:
[0044] Step 110, display a process list, where the process list includes at least one created process.
[0045] In a possible implementation, the process identifiers corresponding to at least one currently created process can be obtained, and a process list is created and displayed based on the obtained at least one process identifier, that is, the process list includes the process identifiers corresponding to the at least one created process, and the user can select a target process to be monitored through the process list.
[0046] Step 120, in response to a monitoring request for the target process in the process list, start the target process and monitor the resource data used by the target process to obtain resource monitoring information.
[0047] In a possible implementation, in the user interface for displaying the process list, selection controls corresponding to each process in the process list can be simultaneously displayed. The user can select the target process to be monitored by triggering the selection control, and can trigger the monitoring operation of the target process by triggering the start monitoring control.
[0048] When a monitoring request for the target process in the process list is received, the target process can be automatically started, and the resource data used by the target process is monitored to obtain resource monitoring information, where the resource monitoring information is the information obtained by monitoring the resource data used by the target process during operation. Optionally, after receiving the monitoring request, the resource data used by the target process can be continuously monitored to obtain resource monitoring information. Optionally, after receiving the monitoring request, the resource data used by the target process can be monitored periodically to obtain resource monitoring information.
[0049] Optionally, the target process can include at least one process. When monitoring requests for multiple target processes are received, each target process can be started separately, and the resource data used by each target process is monitored.
[0050] Optionally, when monitoring the resource data used by the target process, the corresponding system interface can be called to obtain the information corresponding to the resource data used by the target process.
[0051] Optionally, a debugging tool can be used to obtain snapshot information of the resources used by the target process. For example, the WinDbg tool is used to obtain memory snapshot information and handle snapshot information.
[0052] Optionally, the resource data can include at least one of memory data, handle data, thread data, and processor data, that is, at least one of the memory data, handle data, thread data, and processor data used by the target process during operation can be monitored to obtain resource monitoring information.
[0053] Step 130, output the resource usage information corresponding to the target process based on the resource monitoring information.
[0054] The resource usage information includes at least one of resource fluctuation information and resource snapshot information. The resource fluctuation information is used to characterize the fluctuation state of the resource usage amount of the target process within the monitoring time period, and the resource snapshot information is used to characterize the resource usage situation of the target process at a specific moment.
[0055] After obtaining the resource monitoring information, the resource monitoring information can be processed to obtain the resource usage information that can be output and displayed, enabling the user to intuitively obtain the resource usage information corresponding to the target process.
[0056] Optionally, the resource fluctuation information that can be output and displayed can be generated according to the resource usage amount of the target process included in the resource monitoring information within the monitoring time period, so that the user can intuitively obtain the resource usage amount of the target process within the monitoring time period. Herein, the monitoring time period refers to the time period between the start monitoring time point and the end monitoring time point of the target process. Schematically, when monitoring the memory data used by the target process, the memory usage fluctuation information can be generated according to the memory amount used by the target process included in the resource monitoring information within the monitoring time period, enabling the user to intuitively obtain the fluctuation situation of the memory occupied by the target process within the monitoring time period.
[0057] Optionally, the resource monitoring information may further include usage information for indicating the resource data usage situation of the target process at a specific moment. The resource snapshot information can be generated according to the usage information, enabling the user to know the resource usage situation of the target process at a specific moment. Herein, the specific moment can be manually set by the user, or can also be automatically selected according to the monitoring situation.
[0058] Schematically, when monitoring the memory data used by the target process, the usage information such as the size of the memory occupied by the target process, the specific memory area address occupied, and the stored data information at a specific moment can be obtained. The memory snapshot information at the specific moment can be output according to the usage information, enabling the user to know the memory usage situation of the target process at a specific moment.
[0059] In the embodiments of the present disclosure, for the currently created processes, a corresponding process list is displayed. When the user has a monitoring requirement for a target process, a monitoring request for the target process can be triggered through the process list. After receiving the monitoring request for the target process, the corresponding target process is automatically started, and the resource data used by the target process is monitored to obtain resource monitoring information. Thus, the resource usage information corresponding to the target process can be output according to the monitored resource monitoring information, enabling the user to know the resource usage situation of the target process. The operation is simple and helps improve the efficiency of monitoring different processes. In addition, the resource usage information includes at least one of resource fluctuation information and resource snapshot information. The resource fluctuation information enables the user to understand the fluctuation state of the resource usage amount of the target process during the monitoring period, and the resource snapshot information enables the user to understand the resource usage situation of the target process at a specific moment. Thus, whether there is an abnormality in the resource usage of the target process can be analyzed according to at least one of the fluctuation state of the resource usage amount during the monitoring period and the resource usage situation at a specific moment, which helps improve the efficiency of analyzing and locating abnormal problems in the resource usage of the target process.
[0060] In the embodiments of the present disclosure, two monitoring modes are provided, including an automatic monitoring mode and a manual monitoring mode. Different monitoring modes can be used to achieve automatic monitoring of the target process. As Figure 2 shown, it shows a flowchart of a process monitoring method provided by another exemplary embodiment of the present disclosure. This method can be used in the above-mentioned electronic device, and this method includes steps 210-250:
[0061] Step 210, display the process list.
[0062] The implementation manner of step 210 can refer to step 110 in the above embodiment and will not be elaborated here.
[0063] Step 220, in response to a monitoring request for a target process in the process list, obtain the set monitoring mode, where the monitoring mode is used to indicate the monitoring method for resource data.
[0064] Optionally, the monitoring mode can be preset or synchronously set when creating a monitoring command for the target process. In a possible implementation manner, options for different monitoring modes are provided in the user interface, and the user can select the desired monitoring mode through the selection operation of the options.
[0065] Different monitoring modes correspond to different monitoring methods. Specifically, when triggering the monitoring of the target process under different monitoring modes, the methods for obtaining resource monitoring information are different. Optionally, the monitoring modes include an automatic monitoring mode and a manual monitoring mode, and options corresponding to the automatic monitoring mode and the manual monitoring mode are provided in the user interface so that the user can set the monitoring mode based on the options.
[0066] Step 230, in response to the monitoring mode being the automatic monitoring mode, monitor the resource data used by the target process based on the test instruction to obtain resource monitoring information.
[0067] The test instruction is an instruction generated during the execution of the test process by the target process.
[0068] After receiving the monitoring request, obtain the currently set monitoring mode. If the set monitoring mode is the automatic monitoring mode, then monitor the resource data used by the target process according to the test instruction. The automatic monitoring mode is a mode that automatically starts and ends the monitoring of the target process according to the test instruction. In the automatic monitoring mode, after receiving the monitoring request for the target process, the test instruction can be obtained, and the monitoring process of the target process can be controlled according to the test instruction. The test instruction is an instruction generated when testing the object under test. The test of the object under test can be performed based on the target process. The object under test can be a semiconductor device such as a chip or a wafer, or other electronic products, etc. This embodiment does not limit this.
[0069] In a possible implementation manner, when the set monitoring mode is the automatic monitoring mode, communication can be established with the test engine (TestEngine) for issuing test instructions, receive the communication message of the test engine, and monitor the target process according to the test instruction included in the communication message of the test engine.
[0070] Optionally, when the communication message of the test engine includes a test start instruction, the monitoring of the target process can be started, and when the communication message of the test engine includes a test end instruction, the monitoring of the target process can be ended. The monitoring time period in the automatic monitoring mode can be the time period between receiving the test start instruction and receiving the test end instruction.
[0071] When testing the object under test, it includes multiple test items. During the process of testing the object under test based on different test items, corresponding test start instructions and test end instructions are issued for each test item. The monitoring of the target process can be controlled according to the test start instruction and test end instruction corresponding to each test item, and the resource monitoring information obtained by monitoring the resource data used by the target process during the execution of each test item can be obtained.
[0072] Step 240, in response to the monitoring mode being the manual monitoring mode, monitor the resource data used by the target process based on a preset time interval to obtain resource monitoring information.
[0073] If the set monitoring mode is the manual monitoring mode, it is necessary to obtain the preset time interval, and collect the resource data used by the target process based on the preset time interval to obtain resource monitoring information.
[0074] In the manual monitoring mode, when a monitoring request for a target process is received, the monitoring of the resource data used by the target process can be enabled. During the monitoring process, data can be collected periodically. Specifically, the resource data used by the target process is monitored at a preset time interval as a cycle to obtain resource monitoring information.
[0075] When a monitoring stop request for the target process is received, the monitoring of the target process can be ended. The monitoring time period in the manual monitoring mode can be the time period between receiving the monitoring request and receiving the monitoring stop request.
[0076] In a possible implementation manner, a start control for triggering the start of monitoring and an end control for triggering the end of monitoring can be set in the user interaction interface. When a selection operation on the target process in the process list and a triggering operation on the start control are received, it is determined that a monitoring request for the target process is received, and the monitoring of the target process can be enabled. When a triggering operation on the end control is received, it is determined that a monitoring stop request for the target process is received, and the monitoring of the target process can be ended.
[0077] Step 250, based on the resource usage amounts at different times included in the resource monitoring information, output a resource usage statistical graph corresponding to the target process.
[0078] The resource monitoring information includes at least one of memory monitoring information, handle monitoring information, thread monitoring information, and processor occupancy monitoring information.
[0079] Optionally, the resource monitoring information includes the resource usage amounts of the target process at different times. Exemplarily, when the resource monitoring information includes memory monitoring information, the memory monitoring information may include the memory occupancy amounts of the target process at different times. When the resource monitoring information includes handle monitoring information, the handle monitoring information includes the number of handles used by the target process at different times. When the resource monitoring information includes thread monitoring information, the thread monitoring information includes the number of threads used by the target process at different times. When the resource monitoring information includes processor occupancy monitoring information, the processor occupancy monitoring information may include the processor occupancy rates corresponding to the target process at different times, such as the occupancy rate of the Central Processing Unit (CPU).
[0080] According to the resource usage amounts of the target process at different times, a resource usage statistical graph corresponding to the target process within the monitoring time period can be processed. The resource usage statistical graph includes the resource usage amounts of the target process at different times, and the processed resource usage statistical graph is output and displayed, so that the user can intuitively know the resource usage amounts of the target process at different times.
[0081] In a possible implementation, a warning amount of resource usage can be preset in advance. After obtaining the statistical graph of resource usage, the warning amount of resource usage can be acquired. Based on the warning amount of resource usage, a threshold warning line is displayed in the statistical graph of resource usage, and the threshold warning line is used to prompt the view of the resource usage amount exceeding the threshold warning line. Displaying the threshold warning line in the statistical graph of resource usage enables the user to intuitively know the moment when the resource usage amount exceeds the threshold warning line, which helps improve the efficiency of locating and analyzing abnormal resource usage. Exemplarily, a warning amount of memory occupancy can be set for the memory occupancy. According to the memory occupancy of the target process at different times, a corresponding statistical graph of memory usage can be output, and the threshold warning line corresponding to the warning amount of memory occupancy is displayed in the statistical graph of memory usage, enabling the user to know the moment when the memory occupancy exceeds the warning amount of memory occupancy, thereby facilitating the analysis of whether there is an abnormal memory occupancy problem.
[0082] In this embodiment, when monitoring the target process, different monitoring modes are supported. In the automatic monitoring mode, the change of the resource data used by the target process during the test can be automatically monitored. In the manual monitoring mode, the change of the resource data used by the target process can be obtained at regular intervals. The operation is simple, and different modes can be adopted for monitoring, which helps improve the efficiency of obtaining monitoring information and helps improve the efficiency of analyzing abnormal resource usage. In addition, visualizing the change of the resource usage amount through the statistical graph of resource usage can improve the intuitiveness of the output monitoring result, which helps improve the efficiency of locating and analyzing abnormal problems.
[0083] In a possible implementation, the target process includes multiple processes. When outputting the statistical graph of resource usage, the resource usage conditions corresponding to different target processes can be displayed on the same page, or the resource usage conditions of the same target process for different resources can be displayed on the same page, that is, different display modes are supported.
[0084] Optionally, the display mode includes the full-process display mode. In the full-process display mode, the resource usage conditions corresponding to different target processes can be displayed on the same page. When outputting the statistical graph of resource usage corresponding to the target process based on the resource usage amounts at different times included in the resource monitoring information, in response to the selection operation of the full-process display mode, based on the resource usage amounts of each target process at different times included in the resource monitoring information, a line graph of the same type of resource usage corresponding to each target process is generated in the same coordinate system, and the line graph of the same type of resource usage corresponding to each target process is output, where the line graph of resource usage includes at least one of the line graph of memory occupancy, the line graph of handle count, the line graph of thread count, and the line graph of processor occupancy rate.
[0085] Optionally, the resource usage statistical graph can be in the form of a line graph. When the selected display mode is the full-process display mode, the line graphs of the same type of resources corresponding to each target process can be displayed on the same page. Illustratively, when the resource monitoring information includes memory monitoring information, in the full-process display mode, the line graphs of the memory occupancy corresponding to each target process can be generated in the same coordinate system to represent the memory occupancy of each target process at different times.
[0086] In a possible implementation manner, in the full-process display mode, the line graphs of different types of resources can be switched and displayed. In response to the selection operation of the target type of resources in the resource type option, the line graphs of the target type of resources corresponding to each target process are displayed. The resource type option includes selection items corresponding to different types of resources.
[0087] Optionally, the resource type option is displayed in the user interface. The resource type option includes options corresponding to different types of resources. Exemplarily, the resource type option may include a memory option, a handle option, a thread option, and a processor resource option. When the selection operation of the target type of resources in the resource type option is received, the line graphs of the target type of resources corresponding to each target process can be generated in the same coordinate system according to the resource usage amounts of the target type of resources used by each target process at different times, and output for display.
[0088] Illustratively, as Figure 3 shown, in response to the selection operation of the full-process display mode (TotalProcess) 301 and the memory option (Memory) 302 in the resource type option, the line graphs of the memory occupancy corresponding to each target process generated in the same coordinate system can be output for display, representing the memory occupancy of different target threads at different times.
[0089] Optionally, the display mode includes a single-process display mode. In the single-process display mode, the usage situations of different resources of the same target process can be displayed on the same page. In response to the selection operation of the single-process display mode, based on the usage amounts of different resources of the same target thread at different times included in the resource monitoring information, the line graphs of different resources corresponding to the same target process are respectively generated in different coordinate systems, and the line graphs of different resources corresponding to the same target process are output.
[0090] When the selected display mode is the single-process display mode, the resource usage line charts corresponding to different types of resources used by the same target process can be displayed on the same page. Schematically, in the single-process display mode, the line charts of memory occupancy, handle count, thread count, and CPU occupancy rate corresponding to the same target process can be generated based on different coordinate systems and displayed on the same page. Among them, the memory occupancy line chart characterizes the fluctuation of the memory occupancy of the target process during the monitoring period, including the memory occupancy of the target process at different times; the handle count line chart characterizes the fluctuation of the handle count used by the target process during the monitoring period, including the handle count used by the target process at different times; the thread count line chart characterizes the fluctuation of the thread count used by the target process during the monitoring period, including the thread count used by the target process at different times; the CPU occupancy rate line chart characterizes the fluctuation of the CPU occupancy rate of the target process during the monitoring period, including the CPU occupancy rate of the target process at different times.
[0091] In a possible implementation manner, in the single-process display mode, the resource usage line charts corresponding to different target processes can be switched and displayed. In response to the selection operation of the first target process in the process option, the different resource usage line charts corresponding to the first target process are displayed, and the process option includes selection items corresponding to different target processes.
[0092] Optionally, a process option is displayed in the user interface, and the process option includes options corresponding to different monitored target processes, such as process identifiers corresponding to different target processes. When the selection operation of the first target process is received, the different resource usage line charts corresponding to the first target process can be displayed in the user interface.
[0093] Schematically, as Figure 4 shown, in response to the selection operation of the single-process display mode (Signal Process) 401 and the first target process 402, the resource usage line charts corresponding to the first target process generated based on different coordinate systems can be displayed, including the memory occupancy line chart 403, the handle count line chart 404, the thread count line chart 405, and the CPU occupancy rate line chart 406.
[0094] In a possible implementation manner, after generating the resource usage statistical charts corresponding to each target process, the resource usage statistical charts can be saved for subsequent query and use. Optionally, it can be saved as a Comma-Separated Values (CSV) file. Optionally, a data saving path can be preset. When the resource usage statistical chart is generated, it can be stored in the preset data saving path in the CSV file format. When a query request is received, the corresponding resource usage statistical chart is displayed on the user interface for querying historical data.
[0095] In this embodiment, when outputting the resource usage statistical chart of the target process, different display modes are supported. In the full-process display mode, the resource usage line charts corresponding to different processes can be viewed on the same page, which is convenient for comparative analysis of the resource usage of different processes. In the single-process display mode, the resource usage line charts of different types corresponding to the same target process can be viewed on the same page, which is convenient for viewing the fluctuations in the usage of different types of resources by the target process and helps to improve the efficiency of obtaining and analyzing the resource data used by the target process.
[0096] In a possible implementation manner, snapshot information at different times can also be obtained to facilitate the location of abnormal problems. Optionally, memory snapshot information can be obtained, and based on the memory snapshot information, memory leak problems can be analyzed and located; handle snapshot information can also be obtained, and based on the handle snapshot information, memory leak problems can be analyzed and located.
[0097] As Figure 5 shown, during the monitoring of the target process, memory snapshot information and handle snapshot information can be synchronously obtained. After starting to monitor the target process, the first sampling can be performed to obtain memory snapshot information, and the program can be synchronously mounted to attach the debugging tool to the target process to be monitored, so as to access the address space of the target process and obtain the handle data information used by the target process, and thus the handle usage data information can be monitored. After stopping the monitoring of the target process, the second sampling can be performed to obtain memory snapshot information, and the mount can be synchronously removed to generate handle snapshot information. The memory snapshot information obtained by the first sampling and the memory snapshot information obtained by the second sampling can be automatically compared to generate memory comparison information, which can be used to locate and analyze whether there is a memory leak.
[0098] In a possible implementation manner, the debugging tool WinDbg can be used to obtain the memory snapshot information corresponding to the memory used by the target process. When using the WinDbg tool, the User-Mode Stack Trace (UST) function can be enabled, which can record the call stack information during memory allocation and can be used to analyze and locate whether there are problems with abnormal memory usage. After enabling the UST function, the debugging tool can perform the first sampling to obtain memory snapshot information after starting to monitor the target process, and perform the second sampling to obtain memory snapshot information after ending the monitoring of the target process, and perform a comparative analysis on the memory snapshot information obtained by the first sampling and the memory snapshot information obtained by the second sampling.
[0099] During the monitoring of the target process, memory snapshot information can be obtained, that is, the resource monitoring information includes memory snapshot information. In a possible implementation manner, in the automatic monitoring mode, in response to the test start instruction, the start memory snapshot information is obtained, and the start memory snapshot information is used to indicate the memory usage status of the target process when the test start instruction is received; in response to the test end instruction, the end memory snapshot information is obtained, and the end memory snapshot information is used to indicate the memory usage status of the target process when the test end instruction is received.
[0100] In the automatic monitoring mode, when the test start instruction is received, the first sampling is performed to obtain the memory snapshot information, and the start memory snapshot information is obtained. When the test end instruction is received, the second sampling is performed to obtain the memory snapshot information, and the end memory snapshot information is obtained.
[0101] When generating the resource usage information corresponding to the target process based on the resource monitoring information, the start memory snapshot information and the end memory snapshot information can be compared to obtain the first memory comparison information, where the first memory comparison information is used to analyze and locate memory leaks. By comparing the start memory snapshot information and the end memory snapshot information, the first memory comparison information can be obtained, enabling the user to analyze whether there are abnormal problems such as memory leaks during the test based on the first memory comparison information.
[0102] In the manual monitoring mode, in response to the monitoring mode being the manual monitoring mode and receiving the monitoring start instruction, the starting memory snapshot information is obtained, and the starting memory snapshot information is used to indicate the memory usage status of the target process when the monitoring start instruction is received; in response to receiving the monitoring stop instruction, the terminating memory snapshot information is obtained, and the terminating memory snapshot information is used to indicate the memory usage status of the target process when the monitoring stop instruction is received.
[0103] Among them, the monitoring start instruction can be an instruction generated when a trigger operation on the start control is received, and the monitoring stop instruction can be an instruction generated when a trigger operation on the end control is received. In the manual monitoring mode, when the monitoring start instruction is received, the first sampling is performed to obtain the memory snapshot information to get the starting memory snapshot information, and when the monitoring end instruction is received, the second sampling is performed to obtain the memory snapshot information to get the terminating memory snapshot information. When generating the resource usage information corresponding to the target process based on the resource monitoring information, the starting memory snapshot information and the terminating memory snapshot information are compared to obtain the second memory comparison information, where the second memory comparison information is used to analyze and locate memory leaks.
[0104] That is, by comparing the starting memory snapshot information and the terminating memory snapshot information, the second memory comparison information can be obtained, enabling the user to analyze and determine whether there are abnormal problems such as memory leaks during the memory usage of the target process based on the second memory comparison information.
[0105] In the manual monitoring mode, the resource data used by the target process can be monitored based on a preset time interval. During this process, the memory snapshot information at different times can be automatically obtained. This process includes the following steps 1 to 2:
[0106] Step 1, monitor the memory data used by the target process based on a preset time interval to obtain the memory usage at different times.
[0107] During the monitoring of the target process, the memory data used by the target process can be monitored according to the preset time interval to obtain the memory usage (i.e., memory occupancy) at different times.
[0108] Step 2, in response to the difference between the memory usage obtained most recently and the memory usage obtained last time being greater than a preset memory threshold, obtain the memory snapshot information.
[0109] The preset memory threshold is a threshold preset for determining whether to capture a memory snapshot, and it is the threshold corresponding to the difference in memory usage obtained at different times.
[0110] When the difference between the memory usage obtained most recently and the memory usage obtained last time is greater than the preset memory threshold, the memory snapshot information at the time corresponding to the memory usage obtained most recently can be obtained. That is, when there is a difference in memory usage greater than the preset memory threshold between two adjacent acquisitions, a memory snapshot information can be captured once. Based on the preset memory threshold, the memory snapshot information in the case of sudden memory increase can be automatically captured for use in analyzing and locating memory leaks.
[0111] In the automatic monitoring mode, the memory snapshot information can be obtained at the start and end of the test respectively, and the two are automatically compared to generate the first memory comparison information. In the manual monitoring mode, the memory snapshot information can be obtained at the start and end of the manual-triggered monitoring respectively, and the two are automatically compared to generate the second memory comparison information. In the manual monitoring mode, the memory snapshot information in the case of sudden memory increase can also be captured based on the preset memory threshold, that is, the memory snapshot information at multiple different times can be obtained.
[0112] In a possible implementation, the user may have a need to compare the memory snapshot information corresponding to the target process at any two times. In the embodiments of the present disclosure, a snapshot analysis window is provided for the user to select any two memory snapshot information for comparative analysis.
[0113] In response to a selection operation on the first memory snapshot information and the second memory snapshot information within a snapshot analysis window, the first memory snapshot information and the second memory snapshot information are compared and analyzed to obtain third memory comparison information, where the first memory snapshot information and the second memory snapshot information are memory snapshot information obtained at different times.
[0114] The first memory snapshot information and the second memory snapshot information can be memory snapshot information automatically captured at any two times. Optionally, a snapshot save path can be preset in advance. When memory snapshot information is automatically captured, the memory snapshot information can be saved to the snapshot save path. Among them, the file identifier of each memory snapshot information corresponding memory snapshot file can include the process identifier of the corresponding target process and timestamp information, where the timestamp information is used to indicate the time when the memory snapshot information is obtained. Schematically, the name of the file can be named in the way of process identifier + timestamp.
[0115] Within the snapshot analysis window, any two memory snapshot information can be automatically compared and analyzed according to the file identifier. As Figure 6 shown, the snapshot analysis window includes a file path setting item 601, a first setting item (First) 602 corresponding to the first memory snapshot information, and a second setting item (Second) 603 corresponding to the second memory snapshot information, which are used to set the first memory snapshot information and the second memory snapshot information to be compared and analyzed based on the file path setting item 601, the first setting item 602, and the second setting item 603. By triggering the Compare control 604, the third memory comparison information obtained by comparing the first memory snapshot information and the second memory snapshot information can be automatically generated.
[0116] In the embodiments of the present disclosure, memory snapshot information can be automatically captured at the beginning and end of monitoring respectively, and the memory snapshot information captured twice is automatically compared to obtain memory comparison information, so that users can determine whether there are problems such as memory leaks according to the memory comparison information, which helps to improve the efficiency of locating and analyzing abnormal memory usage.
[0117] In addition, in the embodiments of the present disclosure, a snapshot analysis window is provided, enabling users to select memory snapshot information at any two times for comparison and analysis according to their needs, so as to obtain more comparison and analysis information, which helps to improve the efficiency of memory leak location analysis.
[0118] Optionally, the resource snapshot information includes handle snapshot information. In a possible implementation manner, in response to a monitoring request for a target process in a process list, the handle data used by the target process is monitored to obtain handle monitoring information; based on the handle monitoring information, the handle snapshot information of the target process within the monitoring time period is output, and the handle snapshot information is used to analyze and locate handle leaks.
[0119] When a monitoring request for a target process is received, a debugging tool can be mounted on the program corresponding to the target process to access the address space of the target process and obtain the handle data used by the target process. Optionally, the handle monitoring information may include the specific handle types used by the target process at each moment, and the corresponding quantities of each type, etc. When a monitoring stop request is received, the monitoring of the target process can be stopped, the mount can be removed, and a handle snapshot information can be output based on the monitored handle monitoring information. The handle snapshot information is used to indicate the handle usage of the target process at each moment during the monitoring period. Whether there is a handle leak problem can be analyzed based on the handle snapshot information.
[0120] In a possible implementation, as Figure 7 shown, it shows a flowchart of a process monitoring method provided by an exemplary embodiment of the present disclosure. The method includes the following steps:
[0121] Step 710, obtain the selected target process.
[0122] The selected target process is the target process to be monitored.
[0123] Step 720, obtain a preset memory threshold.
[0124] Step 730, obtain the set monitoring mode.
[0125] Step 740, start monitoring.
[0126] In a possible implementation, when the set mode is the automatic monitoring mode, the monitoring of the target process starts when a test start instruction is received. When the set mode is the manual monitoring mode, the monitoring of the target process starts when a trigger operation on the start control is received.
[0127] Step 750, determine whether the monitoring mode is the automatic monitoring mode. If so, execute step 760. If not, execute step 770.
[0128] Step 760, establish communication with TestEngine, and obtain the resource data used by the target process based on the messages of TestEngine.
[0129] Optionally, obtain the resource data used by the target process according to the test instructions included in the messages of TestEngine, including Memory data, Handle data, Thread data, and CPU data.
[0130] Step 770, regularly obtain the resource data used by the target process based on a preset time interval, and capture memory snapshot information based on the preset memory threshold.
[0131] In the manual monitoring mode, resource data used by the target process can be obtained regularly at preset time intervals.
[0132] Step 780: Save the data as a CSV file.
[0133] Step 790: Display the data in the form of a line chart on the page.
[0134] After monitoring and obtaining the resource data used by the target process, on the one hand, the monitored data information can be saved as a CSV file for storage, and on the other hand, the data can be processed to obtain a corresponding line chart of resource usage and displayed in the user interaction interface for the user to view.
[0135] Step 7100: Stop monitoring.
[0136] During the above monitoring process, resource data used by the target process can be monitored to obtain resource fluctuation information. In a possible implementation manner, memory snapshot information can also be obtained to locate and analyze whether there is a memory leak. For example, Figure 7 as shown, after step 740, step 7110 is further included: perform the first sampling to obtain memory snapshot information.
[0137] After step 7100, step 7120 is further included: perform the second sampling to obtain memory snapshot information.
[0138] That is, memory snapshots are captured respectively when starting monitoring and stopping monitoring to obtain memory snapshot information.
[0139] Step 7130: Compare the two memory snapshot information to generate memory comparison information.
[0140] The memory snapshot information of the two samplings can be automatically compared respectively to obtain memory comparison information for analyzing whether there is a memory leak.
[0141] In addition, handle snapshot information can also be obtained to locate and analyze whether there is a handle leak. After step 740, step 7140 is further included: mount the process.
[0142] After step 7100, step 7150 is further included: unmount to generate handle snapshot information.
[0143] For the specific implementation manners of the above steps 710 - 7150, reference can be made to the above embodiments and will not be elaborated here.
[0144] For example, Figure 8 as shown, it shows a schematic structural diagram of a process monitoring device provided by an exemplary embodiment of the present disclosure. The device includes:
[0145] A process display module 810, configured to display a process list, where the process list includes at least one created process;
[0146] A process monitoring module 820, configured to, in response to a monitoring request for a target process in the process list, start the target process and monitor resource data used by the target process to obtain resource monitoring information;
[0147] An information output module 830, configured to output resource usage information corresponding to the target process based on the resource monitoring information, where the resource usage information includes at least one of resource fluctuation information and resource snapshot information, the resource fluctuation information is used to characterize the fluctuation state of the resource usage amount of the target process during a monitoring time period, and the resource snapshot information is used to characterize the resource usage situation of the target process at a specific moment.
[0148] In an exemplary embodiment, the process monitoring module 820 is further configured to:
[0149] In response to a monitoring request for the target process in the process list, obtain a set monitoring mode, where the monitoring mode is used to indicate a monitoring method for the resource data;
[0150] In response to the monitoring mode being an automatic monitoring mode, monitor the resource data used by the target process based on a test instruction to obtain the resource monitoring information, where the test instruction is an instruction generated during a test process executed by the target process;
[0151] In response to the monitoring mode being a manual monitoring mode, monitor the resource data used by the target process based on a preset time interval to obtain the resource monitoring information.
[0152] In an exemplary embodiment, the information output module 830 is further configured to:
[0153] Output a resource usage statistical chart corresponding to the target process based on the resource usage amounts at different moments included in the resource monitoring information, where the resource monitoring information includes at least one of memory monitoring information, handle monitoring information, thread monitoring information, and processor occupancy monitoring information.
[0154] In an exemplary embodiment, the target process includes at least one process;
[0155] The information output module 830 is further configured to:
[0156] In response to a selection operation for the full - process display mode, based on the resource usage amounts of each of the target processes included in the resource monitoring information at different times, generate, within the same coordinate system, line charts of the same type of resource usage corresponding to each of the target processes, and output the line charts of the same type of resource usage corresponding to each of the target processes, where the line chart of resource usage includes at least one of a line chart of memory occupancy, a line chart of the number of handles, a line chart of the number of threads, and a line chart of processor occupancy rate;
[0157] In response to a selection operation for the single - process display mode, based on the usage amounts of different resources of the same target thread at different times included in the resource monitoring information, generate, within different coordinate systems, line charts of different resource usage corresponding to the same target process, and output the line charts of different resource usage corresponding to the same target process.
[0158] In an exemplary embodiment, the information output module 830 is further configured to:
[0159] In response to a selection operation for a target type of resource in the resource type option, display line charts of the target type of resource usage corresponding to each of the target processes, where the resource type option includes selection items corresponding to different types of resources;
[0160] In response to a selection operation for a first target process in the process option, display line charts of different resource usage corresponding to the first target process, where the process option includes selection items corresponding to different target processes.
[0161] In an exemplary embodiment, the information output module 830 is further configured to:
[0162] Obtain a warning amount of resource usage;
[0163] Based on the warning amount of resource usage, display a threshold warning line in the resource usage statistical chart, where the threshold warning line is used to prompt to view the resource usage amount exceeding the threshold warning line.
[0164] In an exemplary embodiment, the resource monitoring information includes memory snapshot information;
[0165] The process monitoring module 820 is further configured to:
[0166] In response to a test start instruction, obtain start memory snapshot information, where the start memory snapshot information is used to indicate the memory usage status of the target process when the test start instruction is received;
[0167] In response to a test end instruction, obtain end memory snapshot information, where the end memory snapshot information is used to indicate the memory usage status of the target process when the test end instruction is received;
[0168] The information output module 830 is further configured to:
[0169] Compare the start memory snapshot information and the end memory snapshot information to obtain first memory comparison information, where the first memory comparison information is used to analyze and locate memory leaks.
[0170] In an exemplary embodiment, the resource monitoring information includes memory snapshot information;
[0171] The process monitoring module 820 is further configured to:
[0172] In response to the monitoring mode being the manual monitoring mode and receiving a monitoring start instruction, obtain start memory snapshot information, where the start memory snapshot information is used to indicate the memory usage status of the target process when the monitoring start instruction is received;
[0173] In response to receiving a monitoring stop instruction, obtain end memory snapshot information, where the end memory snapshot information is used to indicate the memory usage status of the target process when the monitoring stop instruction is received;
[0174] The information output module 830 is further configured to:
[0175] Compare the start memory snapshot information and the end memory snapshot information to obtain second memory comparison information, where the second memory comparison information is used to analyze and locate memory leaks.
[0176] In an exemplary embodiment, the resource monitoring information includes memory snapshot information;
[0177] The process monitoring module 820 is further configured to:
[0178] Monitor the memory data used by the target process based on the preset time interval to obtain the memory usage at different times;
[0179] In response to the difference between the memory usage obtained most recently and the memory usage obtained last time being greater than a preset memory threshold, obtain memory snapshot information.
[0180] In an exemplary embodiment, the device further includes:
[0181] A comparison and analysis module, configured to, in response to a selection operation on the first memory snapshot information and the second memory snapshot information within a snapshot analysis window, compare and analyze the first memory snapshot information and the second memory snapshot information to obtain third memory comparison information, where the first memory snapshot information and the second memory snapshot information are memory snapshot information obtained at different times.
[0182] In an exemplary embodiment, the resource snapshot information includes handle snapshot information;
[0183] The process monitoring module 820 is further configured to, in response to a monitoring request for a target process in the process list, monitor the handle data used by the target process to obtain handle monitoring information;
[0184] The information output module 830 is further configured to:
[0185] Based on the handle monitoring information, output the handle snapshot information of the target process during the monitoring time period, where the handle snapshot information is used to analyze and locate handle leaks.
[0186] The process monitoring device in the embodiments of the present disclosure corresponds to the embodiments of the above-mentioned process monitoring method of the present disclosure, and the relevant content can be referred to each other, and will not be elaborated here. The beneficial technical effects corresponding to the process monitoring device in the embodiments of the present disclosure can be seen in the corresponding beneficial technical effects of the above-mentioned corresponding exemplary method part, and will not be elaborated here.
[0187] In addition, an embodiment of the present disclosure further provides an electronic device, including:
[0188] A memory for storing a computer program;
[0189] A processor for executing the computer program stored in the memory, and when the computer program is executed, implementing the process monitoring method described in any one of the above embodiments of the present disclosure.
[0190] Figure 9 is a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. As Figure 9 shown, the electronic device includes one or more processors and a memory.
[0191] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0192] The memory may store one or more computer program products. The memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products may be stored on the computer-readable storage media, and the processor may run the computer program products to implement the process monitoring methods of the various embodiments of the present disclosure described above and / or other desired functions.
[0193] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0194] In addition, the input device may further include, for example, a keyboard, a mouse, and the like.
[0195] The output device may output various information to the outside, including the determined distance information, direction information, etc. The output device may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, and the like.
[0196] Of course, for simplicity Figure 9 only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, and the like are omitted. In addition, according to specific application scenarios, the electronic device may further include any other appropriate components.
[0197] In addition to the above methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, and when the computer program instructions are run by a processor, the processor is caused to execute the steps in the process monitoring method according to various embodiments of the present disclosure described in the foregoing part of this specification.
[0198] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0199] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are run by a processor, the processor is caused to execute the steps in the process monitoring method according to various embodiments of the present disclosure described in the foregoing part of this specification.
[0200] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0201] The basic principles of the present disclosure have been described in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations. It cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-mentioned specific details are only for illustrative and easy-to-understand purposes and are not limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.
[0202] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For system embodiments, since they basically correspond to method embodiments, the description is relatively simple. For related parts, reference can be made to the description of the method embodiments.
[0203] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended terms, meaning "including but not limited to", and can be used interchangeably with each other. The word "or" and "and" used herein refer to the word "and / or" and can be used interchangeably with each other, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to" and can be used interchangeably with each other.
[0204] The methods and apparatuses of the present disclosure may be implemented in many ways. For example, the methods and apparatuses of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the methods is for illustration only, and the steps of the methods of the present disclosure are not limited to the specific order described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the methods according to the present disclosure.
[0205] It should also be noted that in the apparatuses, devices, and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure.
[0206] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0207] The above description has been presented for purposes of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the form disclosed herein. Although several example aspects and embodiments have been discussed above, those skilled in the art will recognize some of their variations, modifications, alterations, additions, and subcombinations.
Claims
1. A process monitoring method, characterized in that: The method comprises: Display a process list, wherein the process list includes at least one created process; In response to a monitoring request for a target process in the process list, starting the target process and monitoring resource data used by the target process to obtain resource monitoring information; The resource usage information corresponding to the target process is output based on the resource monitoring information, wherein the resource usage information includes at least one of resource fluctuation information and resource snapshot information, wherein the resource fluctuation information is used to characterize the fluctuation state of resource usage of the target process during a monitoring time period, and the resource snapshot information is used to characterize the resource usage of the target process at a specific moment.
2. The method according to claim 1, characterized in that The step of monitoring resource data used by the target process in response to the monitoring request for the target process in the process list to obtain resource monitoring information includes: In response to a monitoring request for the target process in the process list, obtaining a set monitoring mode, wherein the monitoring mode is used to indicate a monitoring method for the resource data; In response to the monitoring mode being the automatic monitoring mode, monitoring resource data used by the target process based on a test instruction to obtain the resource monitoring information, wherein the test instruction is an instruction generated during the execution of a test by the target process; In response to the monitoring mode being the manual monitoring mode, resource data used by the target process is monitored based on a preset time interval to obtain the resource monitoring information.
3. The method according to claim 1, characterized in that The outputting the resource usage information corresponding to the target process based on the resource monitoring information includes: Based on the resource usage at different times included in the resource monitoring information, a resource usage statistics graph corresponding to the target process is output, and the resource monitoring information includes at least one of memory monitoring information, handle monitoring information, thread monitoring information, and processor occupancy monitoring information.
4. The method according to claim 3, characterized in that The target process includes at least one process; The outputting of a resource usage statistical graph corresponding to the target process based on the resource usage at different times included in the resource monitoring information includes: In response to the selection operation of the full process display mode, based on the resource usage of each of the target processes included in the resource monitoring information at different times, a line graph of resource usage of the same type corresponding to each of the target processes is generated in the same coordinate system, and the line graph of resource usage of the same type corresponding to each of the target processes is output, wherein the resource usage line graph includes at least one of a memory usage line graph, a handle number line graph, a thread number line graph, and a processor occupancy line graph; In response to the selection operation of the single process display mode, based on the usage of different resources by the same target thread at different times included in the resource monitoring information, different resource usage line graphs corresponding to the same target process are generated in different coordinate systems, and the different resource usage line graphs corresponding to the same target process are output.
5. The method according to claim 4, characterized in that The outputting the line graph of the same type of resource usage corresponding to each target process includes: In response to a selection operation of a target resource in a resource type option, displaying a line graph of target resource usage corresponding to each target process, wherein the resource type option includes selection items corresponding to different types of resources; The output of the line graph of different resource usage corresponding to the same target process includes: In response to a selection operation on a first target process in a process option, a line graph of different resource usages corresponding to the first target process is displayed, and the process option includes selection items corresponding to different target processes.
6. The method according to claim 3, characterized in that After outputting the resource usage statistics graph corresponding to the target process, the method further includes: Get resource usage warning amount; Based on the resource usage warning amount, a threshold warning line is displayed in the resource usage statistical graph, and the threshold warning line is used to prompt to check the resource usage that exceeds the threshold warning line.
7. The method according to claim 2, characterized in that: The resource monitoring information includes memory snapshot information; The monitoring of resource data used by the target process based on the test instruction to obtain the resource monitoring information includes: In response to a test start instruction, obtaining start memory snapshot information, wherein the start memory snapshot information is used to indicate a memory usage state of the target process when the test start instruction is received; In response to a test end instruction, acquiring end memory snapshot information, wherein the end memory snapshot information is used to indicate a memory usage state of the target process when the test end instruction is received; The generating resource usage information corresponding to the target process based on the resource monitoring information includes: The start memory snapshot information and the end memory snapshot information are compared to obtain first memory comparison information, wherein the first memory comparison information is used to analyze and locate memory leaks.
8. The method according to claim 2, characterized in that: The resource monitoring information includes memory snapshot information; After acquiring the set monitoring mode, the method further includes: In response to the monitoring mode being the manual monitoring mode and receiving a monitoring start instruction, acquiring initial memory snapshot information, the initial memory snapshot information being used to indicate a memory usage state of the target process when the monitoring start instruction is received; In response to receiving a monitoring stop instruction, acquiring termination memory snapshot information, wherein the termination memory snapshot information is used to indicate a memory usage state of the target process when the monitoring stop instruction is received; The generating resource usage information corresponding to the target process based on the resource monitoring information includes: The starting memory snapshot information and the ending memory snapshot information are compared to obtain second memory comparison information, wherein the second memory comparison information is used to analyze and locate memory leaks.
9. The method according to claim 2, characterized in that: The resource monitoring information includes memory snapshot information; The monitoring of the resource data used by the target process based on a preset time interval to obtain the resource monitoring information includes: Monitoring the memory data used by the target process based on the preset time interval to obtain the memory usage at different times; In response to a difference between the most recently acquired memory usage and the last acquired memory usage being greater than a preset memory threshold, memory snapshot information is acquired.
10. The method according to any one of claims 7 to 9, characterized in that: The method further comprises: In response to a selection operation on first memory snapshot information and second memory snapshot information in a snapshot analysis window, a comparison analysis is performed on the first memory snapshot information and the second memory snapshot information to obtain third memory comparison information, wherein the first memory snapshot information and the second memory snapshot information are memory snapshot information acquired at different times.
11. The method according to any one of claims 1 to 9, characterized in that: The resource snapshot information includes handle snapshot information; The method further comprises: In response to a monitoring request for a target process in the process list, monitoring handle data used by the target process to obtain handle monitoring information; The outputting the resource usage information corresponding to the target process based on the resource monitoring information includes: Based on the handle monitoring information, handle snapshot information of the target process within the monitoring time period is output, and the handle snapshot information is used to analyze and locate handle leaks.
12. A process monitoring device, characterized in that: The device comprises: A process display module, used to display a process list, wherein the process list includes at least one created process; A process monitoring module, for responding to a monitoring request for a target process in the process list, starting the target process and monitoring resource data used by the target process to obtain resource monitoring information; An information output module is used to output resource usage information corresponding to the target process based on the resource monitoring information, wherein the resource usage information includes at least one of resource fluctuation information and resource snapshot information, wherein the resource fluctuation information is used to characterize the fluctuation state of resource usage of the target process during a monitoring time period, and the resource snapshot information is used to characterize the resource usage of the target process at a specific moment.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the process monitoring method described in any one of claims 1 to 11 is implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the process monitoring method described in any one of claims 1 to 11 is implemented.
Citation Information
Cited By
Substrate management controller process monitoring method and electronic equipment
CN120743684A