Memory exception monitoring method and device, storage medium and program product

By classifying the virtual memory segments of the application, the total amount of RSS of the virtual memory segments under different types is solved, and the problem of difficult to monitor and locate memory usage exceptions in the prior art is solved, and the stability and fluency monitoring of the application is achieved.

CN119537126APending Publication Date: 2025-02-28DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311121265.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively monitor and locate abnormal memory usage problems during application runtime, and cannot meet the requirements of application stability and fluency.

Method used

By obtaining the key information of multiple virtual memory segments of the target application, performing classification processing, obtaining the total RSS amount of virtual memory segments under different types, and then determining memory usage exceptions.

Benefits of technology

It realizes the rapid and effective location of abnormal memory usage problems during application runtime, which can not only streamline data but also retain information, and improves the stability and fluency of the system and application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537126A_ABST
    Figure CN119537126A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a memory exception monitoring method and device, a storage medium and a program product, and the method comprises the steps: obtaining key information corresponding to a plurality of virtual memory segments of a target application, carrying out the classification processing of the virtual memory segments according to the key information, obtaining classification information, and storing the classification information in the target application. The classification information comprises a plurality of types and the RSS total amount of the virtual memory segments in different types, and determining that the memory use of the target application is abnormal according to the classification information. According to the memory exception monitoring method provided by the embodiment of the invention, the virtual memory segments are classified through the key information of the virtual memory segments based on the application, the total RSS amount of the virtual memory segments in different types is obtained, data can be simplified and the information amount can be reserved through classification processing, and the memory exception monitoring efficiency is improved. And furthermore, the memory use exception problem during application running can be quickly and effectively positioned based on the RSS total quantity under each type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a memory anomaly monitoring method, device, storage medium, and program product. Background Art

[0002] With the rapid increase of virtual memory, physical memory resources are more precious. How to effectively monitor the usage of physical memory is the key to timely discover problems and ensure the stable and smooth operation of systems and applications.

[0003] In the related art, when an operating system evaluates the physical memory of an application, it usually does so by detecting PSS parameters.

[0004] However, the above-mentioned parameter PSS is mainly used to consider the benefits to the overall system, so that a process with a high PSS is selected when recycling a process, which cannot meet the requirements of monitoring the stability and fluency of the application. Summary of the invention

[0005] The embodiments of the present disclosure provide a memory anomaly monitoring method, device, storage medium, and program product to effectively locate abnormal problems in memory usage when an application is running.

[0006] In a first aspect, an embodiment of the present disclosure provides a memory abnormality monitoring method, comprising:

[0007] Obtain key information corresponding to multiple virtual memory segments of the target application;

[0008] Classify the multiple virtual memory segments according to the key information to obtain classification information; the classification information includes multiple types and the total RSS of virtual memory segments under different types;

[0009] Determine, according to the classification information, whether the target application has abnormal memory usage.

[0010] In a second aspect, an embodiment of the present disclosure provides a memory abnormality monitoring device, including:

[0011] An acquisition module, used to acquire key information corresponding to multiple virtual memory segments of a target application;

[0012] A classification module, used for classifying the plurality of virtual memory segments according to the key information to obtain classification information; the classification information includes a plurality of types and the total RSS of the virtual memory segments of different types;

[0013] A determination module is used to determine whether the memory usage of the target application is abnormal according to the classification information.

[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;

[0015] The memory stores computer-executable instructions;

[0016] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the memory exception monitoring method as described in the first aspect and various possible designs of the first aspect.

[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the memory anomaly monitoring method as described in the first aspect and various possible designs of the first aspect is implemented.

[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the memory anomaly monitoring method as described in the first aspect and various possible designs of the first aspect.

[0019] The memory anomaly monitoring method, device, storage medium and program product provided in the present embodiment include obtaining key information corresponding to multiple virtual memory segments of the target application, classifying the multiple virtual memory segments according to the key information to obtain classification information, the classification information includes multiple types and the total RSS of virtual memory segments under different types, and determining the memory usage anomaly of the target application according to the classification information. The memory anomaly monitoring method provided in the present embodiment of the disclosure classifies the virtual memory segments based on the key information of the virtual memory segments of the application, obtains the total RSS of virtual memory segments under different types, and through classification processing, it can both streamline data and retain information, and then can quickly and effectively locate the abnormal problem of memory usage during application runtime based on the total RSS of each type. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0021] Figure 1 A diagram showing the relationship between virtual memory and physical memory provided for related technologies;

[0022] Figure 2 A schematic diagram of a memory anomaly monitoring method flow provided by an embodiment of the present disclosure;

[0023] Figure 3A schematic diagram of the architecture of classification information provided by an embodiment of the present disclosure;

[0024] Figure 4 A structural block diagram of a memory anomaly monitoring device provided in an embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram of the hardware structure of a memory anomaly monitoring device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0027] With the development of CPU hardware technology, the bit width of CPU has gradually increased, for example, from 32 bits to 64 bits. Under 32 bits, the operation of applications is limited to 4GB of virtual memory addressing space, so the main topic of memory optimization is virtual memory. Under 64 bits, the addressing space is 256TB, which can be considered infinite for applications. Therefore, virtual memory is no longer a limitation for the stable operation of applications, and the limitation of physical memory follows.

[0028] Figure 1 A diagram showing the relationship between virtual memory and physical memory provided for related technologies. Figure 1 As shown in the figure, physical memory is the capacity of an actual physical device (such as the capacity of the memory stick actually installed in the computer), which provides the operating system with space for data storage and reading and writing. Its capacity, i.e., addressing space, can usually be configured, which is generally 1GB to 8GB. Virtual memory is the addressing space allocated by the operating system to each process, which is 256TB in 64-bit. When an application allocates memory, the operating system will allocate an area in the address space (such as 1, 2, 3, and 4 in the figure) for the application to use. When an application accesses the allocated virtual memory address, the operating system will allocate an equal amount of physical memory pages in the physical memory to store the application data. According to the needs of the application business, the same physical page can also be allocated to the virtual memory blocks of different applications to achieve memory sharing among multiple applications.

[0029] It can be seen that physical memory can be shared by multiple applications. Compared with virtual memory, physical memory resources are more precious. Physical memory is generally managed by the operating system, but with the popularity of 64-bit CPUs and the surge in virtual memory, physical memory consumption is increasing, and the memory management of the operating system is becoming increasingly stretched. In extreme cases, it seriously affects the stability and smoothness of the system and applications. Therefore, the monitoring and optimization needs of physical memory are gradually being paid attention to.

[0030] In order to clearly explain the memory monitoring means in the related art and the technical problems to be solved by the present disclosure, the following two concepts are first introduced:

[0031] The actual physical memory used by the process (Resident Set Size, RSS)

[0032] Proportional Set Size (PSS)

[0033] RSS and PSS both represent physical memory but they are different because a lot of memory in a process (such as file mapping) is shared by multiple processes. For example, if there is a 2MB file shared by 10 processes, then this part of memory in a process memory data, RSS occupies 2MB, but PSS only occupies 0.2MB. Therefore, the RSS and PSS of a process are usually different.

[0034] When the operating system evaluates the physical memory of an application, it generally selects a process with a high PSS when recycling a process, taking into account the benefits to the overall system. The operating system also provides the application with relevant interfaces to obtain the overall PSS value of the application itself. The overall PSS value is too general and it is difficult to understand the actual physical memory usage of the application, and it is impossible to effectively monitor abnormal memory usage during application runtime.

[0035] In order to solve the above technical problems, the inventors of the present disclosure have found that for applications, more attention should be paid to the part of memory exclusively occupied by the application, so the RSS value can better reflect the actual physical memory consumption of the application. Therefore, it is necessary to collect RSS to find the "large memory block" used by the application, that is, the memory block with abnormal memory usage. In addition, considering that if only the total RSS value of each application is used, the information is still difficult to reflect the location of the memory anomaly, therefore, it is considered that the multiple virtual memory segments corresponding to the application can be classified, and then the memory usage anomaly can be located based on the classification information. Based on this, the embodiment of the present disclosure provides a memory anomaly monitoring method, which classifies the virtual memory segments based on the key information of the virtual memory segments of the application, obtains the total RSS of the virtual memory segments under different types, and through classification processing, it can not only streamline the data but also retain the amount of information, and then can quickly and effectively locate the abnormal problem of memory usage during application runtime based on the total RSS of each type.

[0036] refer to Figure 2 , Figure 2 A flowchart of a memory anomaly monitoring method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device or a server, and the memory anomaly monitoring method includes:

[0037] 201. Obtain key information corresponding to multiple virtual memory segments of a target application.

[0038] Specifically, you can first obtain the identification ID of the target application, that is, PID, and then read / proc / {pid} / smaps. Smaps contains information about all virtual memory segments of the application. Generally, there are thousands or tens of thousands of memory segments in a process. In actual use, when an application freezes, crashes, or becomes unresponsive, you can capture smaps information in the anomaly detection module, extract key information, and report it to the server. The server then classifies and aggregates the information based on feature values ​​such as memory segment name and memory access permissions, and helps R&D personnel analyze and locate the anomaly.

[0039] Exemplarily, the information of each virtual memory segment may include the following:

[0040] Starting virtual address: 7a3ed7839000

[0041] End virtual address: 7a3ed7865000

[0042] Access attribute: r-xp

[0043] Address range: 00013000

[0044] Memory segment name: / system / lib64 / libbase.so

[0045] Memory segment size: 176kB

[0046] PSS: 1kB

[0047] RSS: 92kB

[0048] 202. Classify the multiple virtual memory segments according to the key information to obtain classification information; the classification information includes multiple types and the total RSS of virtual memory segments of different types.

[0049] Specifically, classification and aggregation can be performed based on information such as the memory segment name in smaps to obtain multiple types, as well as the total RSS of all virtual memory segments under each type. Optionally, the classification information can also include the number of all virtual memory segments under each type. The method provided in this embodiment obtains PSS / RSS information / memory segment name / access rights and other information from the smaps node information of the proc file system and reports it to the server. The server then further classifies, aggregates and counts the characteristic information such as the memory segment name / access rights, so as to quickly locate abnormal memory usage.

[0050] In one embodiment of the present disclosure, the multiple types are distributed in a tree structure, the tree structure includes multiple levels of nodes, and the type located at a parent node includes the type located at a corresponding child node.

[0051] For example, Figure 3 As shown, multiple types can form a tree structure

[0052] In one embodiment of the present disclosure, the key information may also include at least one of the following: a starting virtual address, an ending virtual address, an address start and end range, an access attribute, a memory segment name, and a memory segment size.

[0053] Specifically, multiple virtual memory segments of the target application can be classified based on one or more of the key information such as the starting virtual address, the ending virtual address, the address start and end range, the access attribute, the memory segment name, the memory segment size, etc., to obtain multiple types, and further for each type, the total RSS of all virtual memory segments under the type is calculated to finally obtain classification information.

[0054] In one embodiment of the present disclosure, if the key information includes a memory segment name, the memory segment name includes a path keyword under at least one path level. Multiple virtual memory segments may be classified based on the memory segment name.

[0055] In an implementable manner, virtual memory segments under the same path may be classified as the same type according to the path keyword. Classifying the multiple virtual memory segments according to the key information to obtain classification information may include: for each path level, classifying at least one virtual memory segment with the same target path keyword under the path level among the multiple virtual memory segments as the same type to obtain classification information; the target path keyword includes the path keywords under each path level before the path level.

[0056] Specifically, taking the memory segment name of the virtual memory segment as / system / lib64 / libbase.so as an example, it includes three path levels, the path keyword of the first path level is system, the path keyword of the second path level is lib64, and the keyword of the third path level is libbase.so. For the first path level, all virtual memory segments with system are classified as the first type, for the second path level, all virtual memory segments with the path keywords of system and lib64 can be classified as the second type, and for the third path level, all virtual memory segments with system, lib64, and libbase.so can be classified as the third type. Of course, the first type and the second type are in an inclusive relationship, and the second type and the third type are also in an inclusive relationship. That is, the second type is a subtype of the first type, and the third type is a subtype of the second type.

[0057] In another possible implementation, virtual memory segments can be classified according to their functional uses, and specifically, path keyword combinations corresponding to different functional uses can be found. Specifically, the multiple virtual memory segments are classified according to the key information to obtain classification information, which may include: according to the corresponding relationship and the key information, the virtual memory segments with the same path keyword combination corresponding to the key information in the multiple virtual memory segments are classified into the same type to obtain classification information; the path keyword combination is obtained by combining at least one path keyword in the path keywords under the at least one path level, and the corresponding relationship includes keyword combinations corresponding to multiple uses, and each use corresponds to at least one keyword combination.

[0058] Specifically, the path keyword combination corresponding to the file type Files can be found according to the keywords in the memory segment name. Of course, there can be one or more path keyword combinations corresponding to the same type, and each path keyword combination can include one or more path keywords.

[0059] For example, according to usage, multiple virtual memory segments can be divided into reserved space ReservedSpace, Java runtime related to Java programs, native heap structure Native Heap, threads Threads, files Files and devices Devices, corresponding to total physical memory of 56KB, 194.75MB, 247.13MB, 56.23MB, 254.46MB and 2.11MB respectively.

[0060] To learn more information, the above types can be used as parent types, and each parent type can be divided into subtypes. For example, taking the Java runtime (56KB) type as an example, it can be further divided into the following subtypes, and the corresponding RSS totals are in brackets:

[0061] Fixed space (107.33MB)

[0062] dalvik compiler metadata dalvik-compilerMetadata(0B), etc.

[0063] In one embodiment of the present disclosure, multiple pieces of information such as access attributes, memory size, starting virtual address, and ending virtual address may be used to determine the type. If the key information includes access attributes, memory size, starting virtual address, and ending virtual address, the classification of the multiple virtual memory segments according to the key information to obtain classification information may include: determining the adjacent virtual memory segments of the target virtual memory segment according to the starting virtual address and the ending virtual address; obtaining the type of the adjacent virtual memory segment; and determining the type of the target virtual memory segment according to the access attributes, the memory size, and the type of the adjacent virtual memory segment.

[0064] For example, taking a stack type virtual memory segment as an example, since it has a protection page attribute of not being readable, writable or executable, and the memory size is 4K, the adjacent virtual memory segment can be determined as a stack type based on its memory segment name. Therefore, the type of the virtual memory segment can be determined as a stack type based on the above characteristic information.

[0065] 203. Determine, according to the classification information, whether memory usage of the target application is abnormal.

[0066] Specifically, after the total amount of RSS of each type and all virtual memory segments under each type is determined, the abnormal memory usage can be located based on the total amount of RSS under each type.

[0067] In one embodiment of the present disclosure, determining the memory usage anomaly of the target application based on the classification information may include: for each type, comparing the total amount of RSS under the type with the corresponding preset threshold, and determining whether there is an abnormality in the virtual memory segment under the type based on the comparison result.

[0068] In this embodiment, the preset threshold value can be a threshold range for the total amount of RSS under each type, for example, it can be greater than or equal to 95M and less than or equal to 105M, or less than 200M, etc. The total amount of RSS under this type is within this range, which is normal. If it exceeds this range, it can be determined that there is an abnormality in the virtual memory segment under this type. The preset threshold value can also be data monitored by an application during normal operation. This group of data is used as a reference. If the total amount of RSS of each type currently detected differs from the data of the reference group by more than a certain threshold, it can be determined that there is an abnormality in the virtual memory segment under the corresponding type. If the current type is a parent type, then each subtype and the corresponding threshold value can be further checked to find the subtype that may have an abnormality, and so on, until one or more virtual memory segments are located, so that the staff can perform further diagnosis and processing.

[0069] Exemplarily, it is assumed that the classification information includes the first type and the corresponding first RSS total amount, the second type and the corresponding second RSS total amount, and the third type and the corresponding third RSS total amount. The first RSS total amount is 100M, the second RSS total amount is 200M, and the third RSS total amount is 150M. The preset thresholds corresponding to the three are 80M, 210M, and 160M, respectively, and the corresponding threshold ranges are less than or equal to 80M, less than or equal to 210M, and less than or equal to 160M. Therefore, it can be determined that only if the first RSS total amount exceeds its corresponding threshold range, it can be determined that the virtual memory segment under the first type is abnormal.

[0070] In one embodiment of the present disclosure, in order to improve the accuracy of detection, a preset threshold may be determined by multiple sets of data. Specifically, the preset threshold may be determined based on the average value of the number of virtual memory segments obtained when the target application runs normally for multiple times.

[0071] Specifically, the total RSS amount, number of virtual memory segments and other data corresponding to each type when the application is running normally can be obtained multiple times. For each type, the total RSS amount of the type in each group of data is averaged to determine the preset threshold.

[0072] From the above description, it can be seen that by classifying the virtual memory segments based on the key information of the virtual memory segments of the application, the total RSS of the virtual memory segments of different types is obtained. Through classification processing, both data can be streamlined and the amount of information can be retained. Therefore, the abnormal problem of memory usage during application runtime can be quickly and effectively located based on the total RSS of each type.

[0073] Corresponding to the memory anomaly monitoring method in the above embodiment, Figure 4 This is a structural block diagram of a memory anomaly monitoring device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 4 The device includes: an acquisition module 401, a classification module 402 and a determination module 403.

[0074] The acquisition module 401 is used to acquire key information corresponding to multiple virtual memory segments of the target application.

[0075] The classification module 402 is used to classify the multiple virtual memory segments according to the key information to obtain classification information; the classification information includes multiple types and the total RSS of virtual memory segments of different types.

[0076] The determination module 403 is used to determine whether the memory usage of the target application is abnormal according to the classification information.

[0077] In one embodiment of the present disclosure, the key information also includes at least one of the following: a starting virtual address, an ending virtual address, an address start and end range, an access attribute, a memory segment name, and a memory segment size.

[0078] In one embodiment of the present disclosure, if the key information includes a memory segment name, the memory segment name includes a path keyword under at least one path level.

[0079] In one embodiment of the present disclosure, the classification module 402 is specifically used to: for each path level, classify at least one virtual memory segment with the same target path keyword at the path level among the multiple virtual memory segments into the same type to obtain classification information; the target path keyword includes the path keywords at each path level before the path level.

[0080] In one embodiment of the present disclosure, the classification module 402 is specifically used to: classify the virtual memory segments having the same path keyword combination in the corresponding key information among the multiple virtual memory segments into the same type according to the corresponding relationship and the key information, and obtain classification information; the path keyword combination is obtained by combining at least one path keyword among the path keywords under the at least one path level, and the corresponding relationship includes keyword combinations corresponding to multiple uses, and each use corresponds to at least one keyword combination.

[0081] In one embodiment of the present disclosure, if the key information includes access attributes, memory size, a starting virtual address and an ending virtual address, the classification module 402 is specifically used to: determine the adjacent virtual memory segments of the target virtual memory segment according to the starting virtual address and the ending virtual address; obtain the type of the adjacent virtual memory segment; determine the type of the target virtual memory segment according to the access attributes, the memory size and the type of the adjacent virtual memory segment.

[0082] In one embodiment of the present disclosure, the determination module 403 is specifically used to: for each type, compare the total amount of RSS under the type with the corresponding preset threshold, and determine whether there is an abnormality in the virtual memory segment under the type according to the comparison result.

[0083] In one embodiment of the present disclosure, the preset threshold is determined according to an average value of the number of virtual memory segments obtained during multiple normal operations of the target application.

[0084] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.

[0085] In order to implement the above embodiment, the embodiment of the present disclosure also provides an electronic device.

[0086] refer to Figure 5 , which shows a schematic diagram of the structure of an electronic device 900 suitable for implementing the embodiment of the present disclosure, and the electronic device 900 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0087] like Figure 5 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0088] Typically, the following devices may be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0089] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0090] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0091] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0092] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0093] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0094] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0095] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0096] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0097] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 foregoing.

[0098] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0099] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0100] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A memory anomaly monitoring method, characterized in that: include: Obtain key information corresponding to multiple virtual memory segments of the target application; The key information includes the RSS of physical memory actually used by the process; Classify the multiple virtual memory segments according to the key information to obtain classification information; the classification information includes multiple types and the total RSS of virtual memory segments under different types; Determine, according to the classification information, whether the target application has abnormal memory usage.

2. The method according to claim 1, characterized in that The key information includes a memory segment name, and the memory segment name includes a path keyword under at least one path level.

3. The method according to claim 2, characterized in that The classifying the multiple virtual memory segments according to the key information to obtain the classification information includes: For each path level, at least one virtual memory segment with the same target path keyword at the path level among the multiple virtual memory segments is classified into the same type to obtain classification information; the target path keyword includes the path keywords at each path level before the path level.

4. The method according to claim 2, characterized in that: The classifying the multiple virtual memory segments according to the key information to obtain the classification information includes: According to the corresponding relationship and the key information, the virtual memory segments having the same path keyword combination in the corresponding key information among the multiple virtual memory segments are divided into the same type to obtain classification information; the path keyword combination is obtained by combining at least one path keyword among the path keywords under the at least one path level, and the corresponding relationship includes keyword combinations corresponding to multiple purposes, and each purpose corresponds to at least one keyword combination.

5. The method according to claim 1, characterized in that The key information includes access attributes, memory size, a starting virtual address, and an ending virtual address. Classifying the multiple virtual memory segments according to the key information to obtain classification information includes: Determine an adjacent virtual memory segment of the target virtual memory segment according to the starting virtual address and the ending virtual address; Obtaining the type of the adjacent virtual memory segment; The type of the target virtual memory segment is determined according to the access attribute, the memory size, and the type of the adjacent virtual memory segment.

6. The method according to any one of claims 1 to 5, characterized in that: The multiple types are distributed in a tree structure, the tree structure includes multiple levels of nodes, and the type located at a parent node includes the type located at a corresponding child node.

7. The method according to any one of claims 1 to 5, characterized in that: The determining, according to the classification information, that the memory usage of the target application is abnormal includes: For each type, the total amount of RSS under the type is compared with a corresponding preset threshold, and whether there is an abnormality in the virtual memory segment under the type is determined according to the comparison result.

8. A memory anomaly monitoring device, characterized in that: include: An acquisition module, used to acquire key information corresponding to multiple virtual memory segments of a target application; A classification module, used for classifying the plurality of virtual memory segments according to the key information to obtain classification information; the classification information includes a plurality of types and the total RSS of the virtual memory segments of different types; A determination module is used to determine whether the memory usage of the target application is abnormal according to the classification information.

9. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the memory abnormality monitoring method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the memory abnormality monitoring method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for monitoring memory abnormalities as described in any one of claims 1 to 7 is implemented.