CN114416411A - Memory fault detection method and device - Google Patents

Memory fault detection method and device Download PDF

Info

Publication number
CN114416411A
CN114416411A CN202210041212.9A CN202210041212A CN114416411A CN 114416411 A CN114416411 A CN 114416411A CN 202210041212 A CN202210041212 A CN 202210041212A CN 114416411 A CN114416411 A CN 114416411A
Authority
CN
China
Prior art keywords
memory
current system
analysis
analysis result
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210041212.9A
Other languages
Chinese (zh)
Inventor
张航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202210041212.9A priority Critical patent/CN114416411A/en
Publication of CN114416411A publication Critical patent/CN114416411A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/073Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure relates to a memory fault detection method, a memory fault detection device, an electronic device and a computer readable medium. The method comprises the following steps: acquiring the memory occupation amount in the current system in a preset period through a preset application; when the memory occupation amount is larger than a memory threshold value, starting a memory analysis function; analyzing the memory occupation of the current system based on a memory analysis function to generate an analysis result; and when the analysis result has abnormality, generating an abnormality report and generating warning information. The memory fault detection method, the memory fault detection device, the electronic equipment and the computer readable medium can analyze the memory use condition and change in the program operation process from the root more like and more accurately, provide a relatively scientific memory analysis result obtained according to the memory use condition analysis, and effectively perform early warning or alarm, so that an administrator can reduce the work of analyzing the memory.

Description

Memory fault detection method and device
Technical Field
The present disclosure relates to the field of computer information processing, and in particular, to a memory fault detection method and apparatus, an electronic device, and a computer readable medium.
Background
With the development of computers, more and more memory is required for application software programs. When the server where the application software is located runs for a long time, the problems of too large memory usage and too fast growth are inevitable. Particularly, in the java virtual machine, when the memory is increased to a certain extent, the server may be stuck or restarted, and at this time, the reason for the memory increase needs to be analyzed and early warned.
In the prior art, in the running process of application software, a tool capable of monitoring the total memory of a server or the memory use condition of the application software is provided, and when the total memory exceeds a threshold value, an alarm action is performed according to a specified rule. Then the service or server is restarted or the memory usage is manually analyzed by an administrator.
When the memory of the system exceeds the threshold value, the condition of the server is uncertain, and it is likely that the service is suspended because the memory is used too much and grows too fast, and the administrator has not performed positioning yet. The response is not timely, the history is not easy to be saved, and the problem analysis is not facilitated.
Therefore, a new memory failure detection method, device, electronic device and computer readable medium are needed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the application and therefore it may contain information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of this, the present application provides a memory fault detection method, apparatus, electronic device, and computer readable medium, which can analyze the memory usage and changes in the program operation process from the root cause more accurately, and provide a relatively scientific memory analysis result obtained according to the memory usage analysis, so as to effectively perform an early warning or alarm, and reduce the work of analyzing the memory for the administrator.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of the present application, a method for detecting a memory failure is provided, where the method includes: acquiring the memory occupation amount in the current system in a preset period through a preset application; when the memory occupation amount is larger than a memory threshold value, starting a memory analysis function; analyzing the memory occupation of the current system based on a memory analysis function to generate an analysis result; and when the analysis result has abnormality, generating an abnormality report and generating warning information.
In an exemplary embodiment of the present application, further comprising: when the memory occupation amount is larger than a threshold value, calling a preset script file; and generating a log file of the current system at regular time based on the script file.
In an exemplary embodiment of the present application, further comprising: and after the preset application is started, generating the memory threshold according to the configuration of a user.
In an exemplary embodiment of the present application, acquiring the memory usage amount in the current system at a predetermined period through a preset application includes: and monitoring PID numbers through a JPS statement in a preset application to acquire the memory occupation amount in the current system.
In an exemplary embodiment of the present application, monitoring a PID by a JPS statement in a preset application to obtain a memory footprint in a current system includes: monitoring a process PID through a JPS statement in a preset application; acquiring a currently running application software PID based on the process PID; and acquiring the memory occupation amount in the current system based on the currently running application software PID.
In an exemplary embodiment of the present application, analyzing the memory usage of the current system based on the memory analysis function to generate an analysis result includes: and analyzing the memory occupation of the current system based on a memory analysis tool jstat to generate an analysis result.
In an exemplary embodiment of the present application, analyzing the memory usage of the current system based on a memory analysis tool jstat to generate an analysis result, including: acquiring various data in a current system based on a memory analysis tool jstat within preset time; the plurality of data is analyzed to generate an analysis result.
In an exemplary embodiment of the present application, generating an anomaly report and generating warning information when there is an anomaly in the analysis result includes: determining that an abnormality exists when the analysis result meets a preset strategy; and generating an analysis report and warning information according to the analysis result.
In an exemplary embodiment of the present application, the periodically generating a log file of a current system based on the script file includes: executing a memory analysis tool jstat based on the script file; and generating a log file of the current system at regular time based on a jstat memory analysis tool.
According to an aspect of the present application, a memory failure detection apparatus is provided, the apparatus including: the memory module is used for acquiring the memory occupation amount in the current system in a preset period through a preset application; the threshold module is used for starting a memory analysis function when the memory occupation amount is larger than a memory threshold value; the analysis module is used for analyzing the memory occupation of the current system based on the memory analysis function to generate an analysis result; and the warning module is used for generating an abnormal report and generating warning information when the analysis result is abnormal.
According to an aspect of the present application, an electronic device is provided, the electronic device including: one or more processors; storage means for storing one or more programs; when executed by one or more processors, cause the one or more processors to implement a method as above.
According to an aspect of the application, a computer-readable medium is proposed, on which a computer program is stored, which program, when being executed by a processor, carries out the method as above.
According to the memory fault detection method, the memory fault detection device, the electronic equipment and the computer readable medium, the memory occupation amount in the current system is obtained in a preset period through the preset application; when the memory occupation amount is larger than a memory threshold value, starting a memory analysis function; analyzing the memory occupation of the current system based on a memory analysis function to generate an analysis result; when the analysis result is abnormal, the abnormal report is generated and the warning information is generated, so that the memory use condition and the change in the program operation process can be analyzed more accurately from the root, and meanwhile, a relatively scientific memory analysis result obtained according to the memory use condition analysis is provided, so that the early warning or the warning can be effectively performed, and the work of analyzing the memory by an administrator is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The drawings described below are only some embodiments of the present application, and other drawings may be derived from those drawings by those skilled in the art without inventive effort.
Fig. 1 is a system block diagram illustrating a memory failure detection method and apparatus according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method of memory failure detection according to an example embodiment.
Fig. 3 is a schematic diagram illustrating a memory failure detection method according to another exemplary embodiment.
Fig. 4 is a schematic diagram illustrating a memory failure detection method according to another exemplary embodiment.
Fig. 5 is a flow chart illustrating a method of memory failure detection according to another example embodiment.
Fig. 6 is a flow chart illustrating a method of memory failure detection according to another example embodiment.
Fig. 7 is a block diagram illustrating a memory failure detection apparatus according to an example embodiment.
FIG. 8 is a block diagram illustrating an electronic device in accordance with an example embodiment.
FIG. 9 is a block diagram illustrating a computer-readable medium in accordance with an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one element from another. Thus, a first component discussed below may be termed a second component without departing from the teachings of the present concepts. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
It will be appreciated by those skilled in the art that the drawings are merely schematic representations of exemplary embodiments, and that the blocks or processes shown in the drawings are not necessarily required to practice the present application and are, therefore, not intended to limit the scope of the present application.
Fig. 1 is a system block diagram illustrating a memory failure detection method and apparatus according to an exemplary embodiment.
As shown in fig. 1, the system architecture 10 may include servers 101, 102, 103, a network 104, and a user terminal 105. The network 104 serves as a medium for providing communication links between the servers 101, 102, 103 and the user terminal 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The servers 101, 102, 103 interact with the user terminal 105 via the network 104 to receive or send messages or the like. The servers 101, 102, 103 may have various client applications installed thereon, such as data processing applications, search applications, instant messaging tools, mailbox clients, social platform servers, and the like.
Servers 101, 102, 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to business servers, storage servers, search servers, tablets, laptop and desktop computers, and the like.
The user terminal 105 may be a terminal that provides various user query processing services, such as an administrator terminal that manages the servers 101, 102, 103. The administrator terminal can process the received warning information.
The servers 101, 102, 103 may acquire the memory occupation amount in the current system at a predetermined period, for example, through a preset application; the servers 101, 102, 103 may, for example, enable the memory analysis function when the memory footprint is greater than a memory threshold; the servers 101, 102, 103 may analyze the memory usage of the current system, for example, based on a memory analysis function, and generate an analysis result; the servers 101, 102, 103 may generate an abnormality report and generate warning information, for example, when there is an abnormality in the analysis results.
The servers 101, 102, 103 may also send alert information to the user terminal 105, for example.
The servers 101, 102, 103 may also call a preset script file, for example, when the memory occupancy is greater than a threshold; the servers 101, 102, 103 may also periodically generate log files for the current system, e.g., based on the script files.
The servers 101, 102, 103 may also generate the memory threshold according to the configuration of the user terminal 105, for example, after the preset application is started.
The servers 101, 102, and 103 and the user terminal 105 may be a single entity server, or may be composed of multiple servers, for example, it should be noted that the memory failure detection method provided in the embodiment of the present application may be executed by the servers 101, 102, and 103, and accordingly, the memory failure detection apparatus may be disposed in the servers 101, 102, and 1035. And the application end providing for the user to set and alert information processing is typically located in the user terminal 105.
Fig. 2 is a flow chart illustrating a method of memory failure detection according to an example embodiment. The memory failure detection method 20 at least includes steps S202 to S208.
As shown in fig. 2, in S202, the memory usage amount in the current system is obtained in a predetermined period through a preset application. In one embodiment, the PID numbers can be monitored by a JPS statement in a preset application to obtain the memory footprint in the current system.
More specifically, the method for acquiring the memory occupation amount in the current system by monitoring the PID through the JPS statement in the preset application includes: monitoring a process PID through a JPS statement in a preset application; acquiring a currently running application software PID based on the process PID; and acquiring the memory occupation amount in the current system based on the currently running application software PID.
After the software is started, the process PID is monitored through an jps statement, then the PID of the software is obtained, and the PID is used as a memory analysis object.
In S204, when the memory occupancy is greater than the memory threshold, the memory analysis function is enabled.
In one embodiment, further comprising: and after the preset application is started, generating the memory threshold according to the configuration of a user. After the preset application is started, the management user performs processing at the user side so as to configure a memory threshold value at the server side, and performs subsequent processing when the memory exceeds the memory threshold value.
More specifically, the configured memory threshold may be 90%, that is, the memory analysis function is enabled when the memory usage exceeds 90%.
In S206, the memory usage of the current system is analyzed based on the memory analysis function, and an analysis result is generated. The memory occupation of the current system can be analyzed based on a memory analysis tool jstat to generate an analysis result.
The method comprises the following steps of analyzing the memory occupation of the current system based on a memory analysis tool jstat to generate an analysis result, wherein the analysis result comprises the following steps: acquiring various data in a current system based on a memory analysis tool jstat within preset time; the plurality of data is analyzed to generate an analysis result.
In a specific embodiment, when the system memory exceeds 90%, the memory analysis function is started, the script file is called, the java-owned memory analysis tool jstat, jstat-gcutil 59176500010 > memlog _ time.log is executed, and the statement represents that the memory usage of the running program, which is represented by reading the PID 59176 once every 5 seconds, is continuously read for 10 times.
Fig. 3 is a schematic diagram illustrating a memory failure detection method according to another exemplary embodiment. As shown in fig. 3, jstat-gcutil 59176500010 > memlog time log may be executed every 1 minute, read every 6 seconds, and store the files per minute into a separate file, such as memlog _1607510249. log. The text in fig. 3 is used only as an exemplary description, and the modification of the text does not affect the technical content of the present application.
In one embodiment, whether the memory leaks or has insufficient performance can be analyzed according to a preset jstat rule, data is continuously analyzed for 30 minutes, the data is analyzed, and then the analysis is performed according to the following attributes:
s0-percentage of used space in the Survivor space 0 region on the Heap;
s1-percentage of used space in the Survivor space 1 region on the Heap;
e-percentage of used space in the Eden space region on the Heap;
o-percentage of used space in the Old space region on the Heap;
p-percentage of used space in Perm space zone;
YGC-the number of times Young GC occurs from application startup to sampling;
the time taken by YGCT for Young GC from application start-up to sampling (seconds per unit);
FGC — the number of Full GCs occurring from application start to sampling;
the time taken for the FGCT from application start-up to Full GC at sampling (seconds in units);
GCT-total time (seconds per unit) for garbage collection from application start-up to sampling.
In S208, when there is an abnormality in the analysis result, an abnormality report is generated and warning information is generated. Determining that an abnormality exists when the analysis result meets a preset strategy; and generating an analysis report and warning information according to the analysis result.
Fig. 4 is a schematic diagram illustrating a memory failure detection method according to another exemplary embodiment. As shown in FIG. 4, the percentage of Survivor space usage after 5 young gcs was reduced from 73.54% (S0) to 0% (S1).
Memory space is effectively freed, and we can see that memory in the Old space region (O) is recycled after one full gc, from 99.05% to 67.52%.
The total number of times of young gc and full gc, total elapsed time, are printed simultaneously in the figure. The time consumed by young gc each time can be subtracted from two spaced lines of YGCTs. The time spent each full gc can be subtracted from two rows of FGCTs spaced apart.
For example, the young gc takes place 1 time between the first row and the second row, and the elapsed time is 164.262-164.262 seconds (0.0 seconds).
The utilization rate of the resident memory area (P) always stays at about 98.49 percent, which shows that the resident memory has no mutation and is relatively normal, so that the memory over-threshold value is not caused by insufficient memory or leakage.
The text in fig. 4 is used only as an exemplary description, and the modification of the text does not affect the technical content of the present application.
If the memory in the Old space area (O) in fig. 3 is not recycled all the time, and the full gc is maintained for 10 times at 99.05%, it indicates that there is a memory shortage or leakage, a corresponding memory overload alarm is given and prompted, and a system analysis report is output, and an administrator can refer to the result of the system analysis report to process, or view the jstat file retained in the operation process to check manually again.
According to the memory fault detection method, the memory occupation amount in the current system is obtained in a preset period through a preset application; when the memory occupation amount is larger than a memory threshold value, starting a memory analysis function; analyzing the memory occupation of the current system based on a memory analysis function to generate an analysis result; when the analysis result is abnormal, the abnormal report is generated and the warning information is generated, so that the memory use condition and the change in the program operation process can be analyzed more accurately from the root, and meanwhile, a relatively scientific memory analysis result obtained according to the memory use condition analysis is provided, so that the early warning or the warning can be effectively performed, and the work of analyzing the memory by an administrator is reduced.
It should be clearly understood that this application describes how to make and use particular examples, but the principles of this application are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
Fig. 5 is a flow chart illustrating a method of memory failure detection according to another example embodiment. The flow 50 shown in fig. 5 is a supplementary description of the flow shown in fig. 2.
As shown in fig. 5, in S502, when the memory occupancy is greater than the threshold value, the preset script file is called.
In S504, a memory analysis tool jstat is executed based on the script file. Jstat is a lightweight gadget carried by JDK itself. It is called "Java Virtual Machine dynamics monitoring tool". Jstat is located under the bin directory of Java, and mainly utilizes instructions built in JVM to perform real-time command line monitoring on the resources and performance of Java application programs, including monitoring of the Heap size and garbage collection condition.
Jstat can be used to monitor the size of various heaps and non-heaps within VM memory and its memory usage.
And j stat-class pid is used for displaying the information of the number of loaded classes, the occupied space and the like.
j stat-compiler pid is used for displaying information such as the amount of real-time compilation of the VM.
jstat-gc pid can display the information of gc, and check the times and time of gc. The last five items are the number of young gc, the time of young gc, the number of full gc, the time of full gc and the total time of gc.
In S506, a log file of the current system is generated at regular time based on the jstat memory analysis tool. And after the memory threshold is exceeded, calling the script file, executing a self-contained memory analysis tool jstat of java, and generating a log file at intervals.
According to the memory fault detection method, in the running process of the application software, when the system card is dead due to the fact that the memory of the system is increased too fast, the historical record can be kept, and whether the phenomenon is caused by the reasons of memory leakage of the application software or insufficient memory of the system or the like is analyzed to a certain extent.
Fig. 6 is a flow chart illustrating a method of memory failure detection according to another example embodiment. The process 60 shown in fig. 6 is a detailed description of the process shown in fig. 6.
As shown in fig. 6, in S602, a preset application is started.
In S604, a memory threshold for memory analysis is configured.
In S606, the application PID is acquired by JPS.
In S608, the system memory is monitored.
In S610, whether the system memory exceeds a memory threshold.
In S612, memory analysis is enabled, a memory analysis log is generated, and warning information is generated.
After the preset application software is started, a memory threshold value is configured, and when the memory exceeds the memory threshold value, the memory use condition is analyzed.
And after the memory threshold is exceeded, calling the script file, executing a self-contained memory analysis tool jstat of java, and generating a log file at intervals. After the memory threshold value is exceeded, whether the memory leaks or has insufficient performance can be analyzed according to the jstat rule, data are continuously analyzed for 30 minutes, if the memory is insufficient or leaks, corresponding memory overload warning is carried out, and the possibility that the memory is not recovered timely or the performance is insufficient is prompted.
The administrator can refer to the analyzed result of the system for processing, or view the jstat file remained in the running process for manual verification again.
According to the memory fault detection method, once the situation that the memory is insufficient or the memory overflows in the program is suspected in the java software running process, the analysis program is started immediately, and the memory fault detection method has the following advantages:
1. and the file of the memory use condition is stored, and once a problem occurs, the memory use condition change in the program operation process can be traced back.
2. The method has the advantages that the memory use condition and the change in the program operation process are analyzed more like and more accurately from the root, meanwhile, a relatively scientific memory analysis result obtained according to the memory use condition is provided, early warning or warning can be effectively carried out, and the work of analyzing the memory by an administrator is reduced.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. When executed by the CPU, performs the functions defined by the methods provided herein. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the method according to exemplary embodiments of the present application, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 7 is a block diagram illustrating a memory failure detection apparatus according to an example embodiment. As shown in fig. 7, the memory failure detection apparatus 70 includes: a memory module 702, a threshold module 704, an analysis module 706, and an alert module 708. The memory failure detection apparatus 70 may further include: a log module 710.
The memory module 702 is configured to obtain a memory occupancy amount in a current system in a predetermined period through a preset application; the memory module 702 is further configured to monitor PID numbers through a JPS statement in a preset application to obtain a memory occupancy amount in the current system.
The threshold module 704 is configured to enable a memory analysis function when the memory occupancy is greater than a memory threshold;
the analysis module 706 is configured to analyze memory usage of the current system based on a memory analysis function, and generate an analysis result; the analysis module 706 is further configured to analyze the memory usage of the current system based on a memory analysis tool jstat, and generate an analysis result.
The warning module 708 is configured to generate an exception report and generate warning information when there is an exception in the analysis result. The warning module 708 is further configured to determine that an anomaly exists when the analysis result meets a preset policy; and generating an analysis report and warning information according to the analysis result.
The log module 710 is configured to call a preset script file when the memory occupancy is greater than a threshold; and generating a log file of the current system at regular time based on the script file.
According to the memory fault detection device, the memory occupation amount in the current system is obtained in a preset period through a preset application; when the memory occupation amount is larger than a memory threshold value, starting a memory analysis function; analyzing the memory occupation of the current system based on a memory analysis function to generate an analysis result; when the analysis result is abnormal, the abnormal report is generated and the warning information is generated, so that the memory use condition and the change in the program operation process can be analyzed more accurately from the root, and meanwhile, a relatively scientific memory analysis result obtained according to the memory use condition analysis is provided, so that the early warning or the warning can be effectively performed, and the work of analyzing the memory by an administrator is reduced.
FIG. 8 is a block diagram illustrating an electronic device in accordance with an example embodiment.
An electronic device 800 according to this embodiment of the application is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one memory unit 820, a bus 830 connecting the various system components (including the memory unit 820 and the processing unit 810), a display unit 840, and the like.
Wherein the storage unit stores program code that can be executed by the processing unit 810, such that the processing unit 810 performs the steps according to various exemplary embodiments of the present application described in the present specification. For example, the processing unit 810 may perform the steps as shown in fig. 2, 5, 6.
The memory unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The memory unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 800' (e.g., keyboard, pointing device, bluetooth device, etc.) such that a user can communicate with devices with which the electronic device 800 interacts, and/or any devices (e.g., router, modem, etc.) with which the electronic device 800 can communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860. The network adapter 860 may communicate with other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, as shown in fig. 9, the technical solution according to the embodiment of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment of the present application.
The software product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The computer readable medium carries one or more programs which, when executed by a device, cause the computer readable medium to perform the functions of: acquiring the memory occupation amount in the current system in a preset period through a preset application; when the memory occupation amount is larger than a memory threshold value, starting a memory analysis function; analyzing the memory occupation of the current system based on a memory analysis function to generate an analysis result; and when the analysis result has abnormality, generating an abnormality report and generating warning information.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present application.
Exemplary embodiments of the present application are specifically illustrated and described above. It is to be understood that the application is not limited to the details of construction, arrangement, or method of implementation described herein; on the contrary, the intention is to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A memory fault detection method is characterized by comprising the following steps:
acquiring the memory occupation amount in the current system in a preset period through a preset application;
when the memory occupation amount is larger than a memory threshold value, starting a memory analysis function;
analyzing the memory occupation of the current system based on a memory analysis function to generate an analysis result;
and when the analysis result has abnormality, generating an abnormality report and generating warning information.
2. The method of claim 1, further comprising:
when the memory occupation amount is larger than a threshold value, calling a preset script file;
and generating a log file of the current system at regular time based on the script file.
3. The method of claim 1, further comprising:
and after the preset application is started, generating the memory threshold according to the configuration of a user.
4. The method as claimed in claim 1, wherein obtaining the memory occupation amount in the current system by the preset application in a predetermined period comprises:
and monitoring PID numbers through a JPS statement in a preset application to acquire the memory occupation amount in the current system.
5. The method as claimed in claim 4, wherein monitoring PID to obtain memory footprint in current system by JPS statement in preset application comprises:
monitoring a process PID through a JPS statement in a preset application;
acquiring a currently running application software PID based on the process PID;
and acquiring the memory occupation amount in the current system based on the currently running application software PID.
6. The method of claim 1, wherein analyzing the memory usage of the current system based on the memory analysis function to generate an analysis result comprises:
and analyzing the memory occupation of the current system based on a memory analysis tool jstat to generate an analysis result.
7. The method as claimed in claim 6, wherein analyzing the memory usage of the current system based on the memory analysis tool jstat to generate an analysis result comprises:
acquiring various data in a current system based on a memory analysis tool jstat within preset time;
the plurality of data is analyzed to generate an analysis result.
8. The method of claim 1, wherein generating an exception report and generating alert information when an exception exists in the analysis results comprises:
determining that an abnormality exists when the analysis result meets a preset strategy;
and generating an analysis report and warning information according to the analysis result.
9. The method of claim 2, wherein periodically generating a log file for a current system based on the script file comprises:
executing a memory analysis tool jstat based on the script file;
and generating a log file of the current system at regular time based on a jstat memory analysis tool.
10. A memory failure detection apparatus, comprising:
the memory module is used for acquiring the memory occupation amount in the current system in a preset period through a preset application;
the threshold module is used for starting a memory analysis function when the memory occupation amount is larger than a memory threshold value;
the analysis module is used for analyzing the memory occupation of the current system based on the memory analysis function to generate an analysis result;
and the warning module is used for generating an abnormal report and generating warning information when the analysis result is abnormal.
CN202210041212.9A 2022-01-14 2022-01-14 Memory fault detection method and device Pending CN114416411A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210041212.9A CN114416411A (en) 2022-01-14 2022-01-14 Memory fault detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210041212.9A CN114416411A (en) 2022-01-14 2022-01-14 Memory fault detection method and device

Publications (1)

Publication Number Publication Date
CN114416411A true CN114416411A (en) 2022-04-29

Family

ID=81272554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210041212.9A Pending CN114416411A (en) 2022-01-14 2022-01-14 Memory fault detection method and device

Country Status (1)

Country Link
CN (1) CN114416411A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI835479B (en) * 2022-12-21 2024-03-11 神雲科技股份有限公司 Electronic device and memory management method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI835479B (en) * 2022-12-21 2024-03-11 神雲科技股份有限公司 Electronic device and memory management method

Similar Documents

Publication Publication Date Title
US20190347148A1 (en) Root cause and predictive analyses for technical issues of a computing environment
US20200293946A1 (en) Machine learning based incident classification and resolution
US20190228296A1 (en) Significant events identifier for outlier root cause investigation
US7856575B2 (en) Collaborative troubleshooting computer systems using fault tree analysis
US9038030B2 (en) Methods for predicting one or more defects in a computer program and devices thereof
CN110516971B (en) Anomaly detection method, device, medium and computing equipment
CN110908883B (en) User portrait data monitoring method, system, equipment and storage medium
US11610136B2 (en) Predicting the disaster recovery invocation response time
CN112000806A (en) Abnormal log monitoring and analyzing method, system, equipment and storage medium
CN114416411A (en) Memory fault detection method and device
CN114048099A (en) Java application monitoring method and device, storage medium and electronic equipment
CN113609008A (en) Test result analysis method and device and electronic equipment
CN111488316B (en) File cache recovery method and device
CN113791943A (en) Website real-time monitoring method, system, equipment and storage medium
JP2008210151A (en) Failure prediction system
CN109271289B (en) Application interface monitoring method, device, equipment and computer readable medium
US9952773B2 (en) Determining a cause for low disk space with respect to a logical disk
CN113342619A (en) Log monitoring method and system, electronic device and readable medium
CN114827157A (en) Cluster task processing method, device and system, electronic equipment and readable medium
CN113934595A (en) Data analysis method and system, storage medium and electronic terminal
CN113419887A (en) Method and device for processing abnormal online transaction of host
CN115145623A (en) White box monitoring method, device, equipment and storage medium of software business system
CN112131090A (en) Business system performance monitoring method and device, equipment and medium
US11556446B2 (en) Programmatic performance anomaly detection
CN113836004B (en) Application program positioning analysis method, device, equipment and storage medium

Legal Events

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