Method, device, storage medium and electronic device for locating memory leak

By detecting the type of memory leak of embedded devices and traversing the memory information of memory blocks, and positioning the target memory block according to the memory size and application functions, the problem of memory leaks of embedded devices is solved, and the code failures can be quickly diagnosed.

CN114443479BActive Publication Date: 2025-08-05ZHUHAI HUGE IC CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210082183.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-24
Publication Date
2025-08-05
Estimated Expiration
2042-01-24

AI Technical Summary

Technical Problem

In the prior art, the positioning of memory leakage of embedded devices is time-consuming and inefficient, affecting system stability.

Method used

By detecting the memory leakage type, traversing the memory information of the memory block, positioning the target memory block according to the memory size and application functions, improving positioning efficiency.

Benefits of technology

Quickly diagnose code failures, improve memory block positioning efficiency and speed, and reduce manual troubleshooting time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114443479B_ABST
    Figure CN114443479B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, device, storage medium, and electronic device for locating memory leaks, which relate to the field of storage control. When it is detected that a memory leak occurs in an embedded device, the present application determines the type of the memory leak, and then traverses the memory information of each memory block in the memory to locate the target memory block according to the memory size and memory application function in the memory information, so that the user can exclude code faults from the memory data in the target memory block. Compared with manually checking and locating memory spaces one by one, the efficiency and speed of locating memory blocks can be improved, so as to quickly diagnose code faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage control, and in particular to a method, device, storage medium and electronic device for locating memory leaks. Background Art

[0002] Due to memory limitations, embedded devices require more compact and efficient code. Memory leaks are a common exception during code execution, severely impacting system stability. Therefore, memory data must be checked to quickly troubleshoot and diagnose code failures. In existing technologies, when a memory leak occurs, testers must sequentially check the allocated memory space based on the error message. This troubleshooting method is often time-consuming, difficult, and inefficient. Summary of the Invention

[0003] The present invention provides a method, device, storage medium, and electronic device for locating a memory leak, which can solve the problem of long time consumption and low efficiency in locating the faulty memory space when a memory leak occurs in the prior art. The technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a method for locating a memory leak, comprising:

[0005] When a memory leak is detected in an embedded device, the type of memory leak is determined;

[0006] If the type is a continuous leak, after waiting for a first preset time, traverse all memory blocks in the memory and obtain memory information from a memory information storage area of each memory block; wherein the memory block includes a data storage area and a memory information storage area, and the memory information includes a start flag, an end flag, memory size information, memory application time, and memory application function information;

[0007] Get the memory size and memory request function of each memory block based on memory information;

[0008] Searching for memory blocks whose number of memory blocks having the same memory request function and memory size exceeds a preset number among all the memory blocks, and using the found memory blocks as target memory blocks.

[0009] In a second aspect, an embodiment of the present application provides a memory leak location device, including:

[0010] a determination unit, configured to determine the type of memory leak when a memory leak is detected in the embedded device;

[0011] A traversal unit, configured to, if the type is continuous leakage, traverse all memory blocks in the memory after waiting for a first preset duration, and obtain memory information from the memory information storage areas of each memory block; wherein, the memory block includes a data storage area and the memory information storage area, and the memory information includes a start flag bit, an end flag bit, memory size information, memory application time, and memory application function information.

[0012] An acquisition unit, configured to obtain the memory size and memory application function of each memory block according to the memory information.

[0013] A search unit, configured to search for memory blocks in all the memory blocks where the number of memory blocks with the same memory application function and memory size exceeds a preset number, and use the found memory blocks as target memory blocks.

[0014] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores multiple instructions, and the instructions are suitable for being loaded and executed by a processor to perform the above method steps.

[0015] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein, the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor to perform the above method steps.

[0016] The beneficial effects brought by the technical solutions provided by some embodiments of the present application at least include:

[0017] When detecting a memory leak in an embedded device, determine the type of memory leak, then traverse the memory information of each memory block in the memory, and locate the target memory block according to the memory size and memory application function in the memory information, so that the user can exclude code faults for the memory data in the target memory block. Compared with manually checking and locating memory spaces one by one, it can improve the efficiency and speed of locating memory blocks, so as to quickly diagnose code faults. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0019] Figure 1 is a schematic diagram of the electronic device provided by the embodiment of the present application;

[0020] Figure 2 is a schematic flowchart of the memory leak location method provided by the embodiment of the present application;

[0021] Figure 3 It is a schematic structural diagram of a memory block provided by an embodiment of the present application;

[0022] Figure 4 It is a schematic diagram of extracting memory information provided by an embodiment of the present application;

[0023] Figure 5 It is a schematic structural diagram of a memory leak location device provided by the present application;

[0024] Figure 6 It is a schematic structural diagram of an electronic device provided by the present application. Detailed implementation manners

[0025] To make the objectives, technical solutions and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.

[0026] It should be noted that the control of the memory provided by the present application is generally executed by the memory leak location device 101. Correspondingly, the memory leak location device 101 is generally disposed in the electronic device 10.

[0027] Figure 1 It shows a structural diagram of an electronic device to which the present application can be applied.

[0028] In addition to including a housing, the electronic device 10 further includes a memory leak location device 101 (abbreviated as the location device 101) and a memory 102. The number of flash memories can be one or more, and the location device 101 and the memory 102 are connected to each other. The electronic device is various electronic devices with a display screen, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, etc. For example: The display device can be a cathode ray tube display (CR for short), a light-emitting diode display (LED for short), an electronic ink screen, a liquid crystal display (LCD for short), a plasma display panel (PDP for short), etc. The user can use the display device on the electronic device to view information such as text, pictures, videos, etc. displayed.

[0029] A camera can also be installed on the electronic device, and the camera is used to collect video streams.

[0030] The following will combine the attached Figure 2 , and will introduce in detail the memory leak location method provided by the embodiment of the present application.

[0031] Please refer to Figure 2 , which is a schematic flowchart of a method for locating memory leaks provided by an embodiment of the present application. As Figure 2 shown, the method of the embodiment of the present application may include the following steps:

[0032] S201. When it is detected that a memory leak occurs in the embedded device, determine the type of the memory leak.

[0033] Among them, a memory leak refers to a phenomenon where the dynamically allocated memory in the memory is not released or cannot be released for a long time, resulting in memory waste. After the embedded device is powered on, the target code will run. The target code consists of the main code and multiple sub-codes for performing specific functions. During the running of the target code, the embedded device will allocate or release memory blocks for the target code in a dynamic manner. Under normal memory usage, the size of the free space in the memory is relatively stable, that is, the size of the free space fluctuates within a specified range; when a memory leak occurs, the size of the free space in the memory will gradually decrease. The types of memory leaks in the present application include continuous leaks and functional leaks. A continuous leak means that the size of the free space in the memory gradually decreases after the device is powered on, and a functional leak means that triggering a certain function causes the size of the free space in the memory to gradually decrease.

[0034] In the embodiment of the present application, the method for determining the type of memory leak includes:

[0035] Monitor the change in the size of the free space in the memory;

[0036] When the embedded device is powered on, if the free space gradually decreases to a preset threshold, determine that the type is a continuous leak; or

[0037] When a function of the embedded device is enabled, if the free space in the memory gradually decreases to a preset threshold, determine that the type is a functional leak.

[0038] Among them, the embedded device periodically detects the size of the free space in the memory when it is powered on. If it is monitored that the free space gradually decreases to a preset threshold when the device is powered on, for example: the preset threshold is 8 bytes, it is determined that the type of memory leak is a continuous leak. When a function of the embedded device is enabled, if the free space in the memory gradually decreases to a preset threshold, it is determined that the type of memory leak is a functional leak. For example: during the running of the target code, when the graphic display function of the embedded device is enabled and it is monitored that the free space in the memory gradually decreases to 8 bytes, it is determined that the type of memory leak is a functional leak. The preset threshold of the present application is generally greater than 0 bytes.

[0039] In one or more possible embodiments, before S201, it further includes:

[0040] Run the target code in the embedded device, and during the running of the target code, allocate or release memory blocks for the target code in the memory.

[0041] Among them, this application can allocate a memory block of a certain size based on the memory allocation request of the target code, or release the corresponding memory block based on the memory release request of the target code, or monitor the existence time of each memory block, and release the memory block when the existence time is greater than the application time of the memory block, so as to improve the space utilization rate of the memory.

[0042] S202. If the type is continuous leakage, wait for the first preset duration and then traverse all memory blocks in the memory, and obtain the memory information in the memory information storage of each memory block.

[0043] Among them, this application uses the method of memory blocks to allocate memory space for the target code. The number of memory blocks may be multiple at a certain moment, and the memory block will be released when the target code does not need to use a certain memory block. The memory block includes a data storage area and a memory information storage area. The data storage area is used to store actual data, and the memory information storage area is used to store the memory information of the memory block, that is, the attribute information of the memory block. The memory information includes the following fields: memory start flag bit, memory end flag bit, memory size information, memory application time information, and memory application function information. Each field is stored in different areas of the memory block, and the size of each area can be determined according to actual needs, and this application does not make any restrictions. The memory start flag bit and the memory end flag bit are used to distinguish the start position and the end position of the memory block. The memory size information represents the size of each area in the memory block. The memory application time information represents the start time and / or application duration (that is, the duration of occupying the memory block) of the memory block application. The memory application function information represents the identity of the function that applies for the memory block, such as: function name or function ID, etc.

[0044] In one or more possible embodiments, refer to Figure 3Schematic diagram of the structure of the memory block shown. Each memory block includes: a data storage area and a memory information storage area. The memory information storage area includes: a memory start flag storage area, a memory size information storage area, a memory application time information storage area, a memory application function storage area, and a memory end flag storage area. The memory start flag storage area is located at the beginning of the memory block, and the memory end flag storage area is located at the end of the memory block. The memory start flag storage area is used to store the memory start flag bit, and the memory end flag storage area is used to store the memory end position. For example, the lengths of the memory start flag bit and the memory end position bit are 1 byte, the value of the memory start flag bit is 0x00, and the value of the memory end flag bit is 0xFF. The memory size information storage area is used to store the memory size information, the memory application time storage area is used to store the memory application time, the memory application function storage area is used to store the identity information of the function that applied for the memory block, and the data storage area is used to store the actual memory data.

[0045] In this application, when the type of memory leak is continuous leakage, wait for the first preset duration, which can be determined according to actual needs. After waiting for the first preset duration, ensure that the size of the free space in the memory approaches 0 bytes. Then, after the embedded device allocates a memory block, it will store the ID and address of the memory block in the memory block allocation record table. Therefore, all memory blocks in the memory can be traversed according to the memory block allocation record table. The number of memory blocks may be multiple. For each memory block traversed, obtain the memory size information, memory application information, and memory function information from the memory information storage area in the memory block.

[0046] For example: Refer to Figure 4 As shown, N memory blocks are allocated in the memory, where N is an integer greater than or equal to 1. Extract the memory information from the memory information storage area in the memory block to obtain the memory location, flag bits (start flag bit and end flag bit), application time (in milliseconds), and application function name of each memory block. This application can perform verification based on whether the values of the start flag bit and the end flag bit are preset values. For example, the preset value of the start flag bit is 0x00, and the preset value of the end flag bit is 0xFF. Compare the actual values with the preset values to obtain the verification result.

[0047] S203. Obtain the memory size and memory application function of each memory block according to the memory information.

[0048] S204. In all memory blocks, find the memory blocks whose number of memory blocks with the same memory application function and memory size exceeds the preset number, and use the found memory blocks as the target memory blocks.

[0049] Among them, the preset quantity is 3. Search for memory blocks with the same memory application function and memory size in all memory blocks, and count the number of memory blocks that meet the above conditions. When the number exceeds the preset quantity of 3, it indicates that a certain function is repeatedly requesting to allocate memory blocks, and this memory allocation situation is abnormal. Take the multiple memory blocks found above as the target memory blocks to be located, so that the user can troubleshoot the memory data in these target memory blocks to determine the bugs in the target code. Further, this application can determine memory blocks in all memory blocks whose existence time exceeds the application time, and release the above memory blocks to increase the free space of the memory.

[0050] Further, the embedded device obtains the quantity, address, and ID of the target memory blocks, and displays the quantity, address, and ID through the display unit, so that the user can quickly locate the target memory blocks based on the information on the display unit.

[0051] In one or more possible embodiments, it further includes:

[0052] If the type is function leakage, the embedded device performs a restart operation, and records the boot time t0 after successful restart;

[0053] Based on the boot time t0 of the embedded device, the function causing function leakage in the target code is enabled at time t1; where the time interval between time t1 and time t0 is the second preset duration, and the size of the second preset duration can be determined according to actual needs. For example, if the function causing function leakage is the display function, then the display function is enabled 5 seconds after the start time.

[0054] Traverse all memory blocks in the memory, and obtain the memory application time information in the memory information storage area of each memory block; according to the above embodiment, traverse all memory blocks according to the memory block allocation record table, and the memory application time information includes the memory application moment, that is, the moment when the memory block is allocated.

[0055] According to the memory application time information, search for memory blocks that are applied after time t1 in each memory block, and take the found memory blocks as target memory blocks. The user uses the memory data in the target memory blocks for troubleshooting, so as to quickly determine the bugs in the target code.

[0056] Implementing the embodiments of this application, when it is detected that a memory leak occurs in the embedded device, determine the type of memory leak, then traverse the memory information of each memory block in the memory, and locate the target memory block according to the memory size and memory application function in the memory information, so that the user can exclude code faults with the memory data in the memory target memory block. Compared with manually troubleshooting and locating the memory space one by one, it can improve the efficiency and speed of locating the memory block, so as to quickly diagnose code faults.

[0057] The following is an embodiment of the device of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the device embodiment of the present application, please refer to the method embodiment of the present application.

[0058] Please refer to Figure 5 , which shows a schematic structural diagram of a memory leak localization device provided by an exemplary embodiment of the present application, hereinafter referred to as device 5. The device 5 can be implemented as all or part of an electronic device through software, hardware, or a combination of both. The device 5 includes: a determination unit 501, a traversal unit 502, an acquisition unit 503, and a search unit 504.

[0059] The determination unit 501 is configured to determine the type of memory leak when it detects that a memory leak occurs in the embedded device;

[0060] The traversal unit 502 is configured to, if the type is continuous leak, wait for a first preset duration and then traverse all memory blocks in the memory, and obtain memory information in the memory information storage area of each memory block; wherein, the memory block includes a data storage area and the memory information storage area, and the memory information includes a start flag bit, an end flag bit, memory size information, memory application time, and memory application function information;

[0061] The acquisition unit 503 is configured to obtain the memory size and memory application function of each memory block according to the memory information;

[0062] The search unit 504 is configured to search for memory blocks in all the memory blocks where the number of memory blocks with the same memory application function and memory size exceeds a preset number, and use the found memory blocks as target memory blocks.

[0063] In one or more possible embodiments, the search unit 504 is further configured to:

[0064] If the type is functional leak, restart the embedded device;

[0065] Based on the boot time t0 of the embedded device, enable the function that causes the functional leak in the target code at time t1; wherein the time interval between time t1 and time t0 is a second preset duration;

[0066] Traverse all memory blocks in the memory, and obtain memory application time information in the memory information storage area of each memory block;

[0067] Search for memory blocks that are applied after time t1 in each memory block according to the memory application time information, and use the found memory blocks as target memory blocks.

[0068] In one or more possible embodiments, the memory information storage area consists of a memory start flag storage area, a memory size information storage area, a memory application time information storage area, a memory application function information storage area, a data storage area, and a memory end flag storage area.

[0069] In one or more possible embodiments, all memory blocks in the memory are traversed according to a preset memory block allocation record table.

[0070] In one or more possible embodiments, determining the type of memory leak includes:

[0071] Monitoring the change in the size of the free space in the memory;

[0072] When the embedded device is powered on, if the free space gradually decreases to a preset threshold, it is determined that the type is continuous leakage; or

[0073] When the function of the embedded device is enabled, if the free space in the memory gradually decreases to a preset threshold, it is determined that the type is function leakage.

[0074] In one or more possible embodiments, the acquisition unit 504 is further configured to:

[0075] Acquire the quantity, address, and ID of the target memory block, and display the quantity, address, and ID through the display unit.

[0076] In one or more possible embodiments, it further includes:

[0077] A running unit, configured to run the target code in the embedded device;

[0078] During the running of the target code, allocate or release memory blocks for the target code in the memory.

[0079] It should be noted that when the device 5 provided in the above embodiment executes the memory leak localization method, only the above-mentioned division of each functional module is used for illustration. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, the memory leak localization device provided in the above embodiment and the memory leak localization method embodiment belong to the same concept. The implementation process is detailed in the method embodiment and will not be elaborated here.

[0080] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages and disadvantages of the embodiments.

[0081] The embodiment of the present application further provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor to perform the method steps of the embodiment as described above Figure 2 The specific execution process can be referred to Figure 2 the specific description of the embodiment shown, and details are not described herein.

[0082] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the memory leak location method described in each of the above embodiments.

[0083] Please refer to Figure 6 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 6 shown, the electronic device 600 may include: at least one processor 601, at least one communication interface 604, a user interface 603, a memory 605, and at least one communication bus 602.

[0084] Among them, the communication bus 602 is used to implement connection communication between these components.

[0085] Optionally, the electronic device further includes a user interface 603 for performing human-computer interaction operations. For example: the user interface 603 may include a display screen (Display) and a camera (Camera).

[0086] Among them, the electronic device is provided with a communication interface 604 for communicating with external devices. Correspondingly, the communication interface 604 may be a wireless interface, for example: including a WI-FI interface, a Bluetooth interface, etc.

[0087] Among them, the processor 601 may include one or more processing cores. The processor 601 connects various parts within the entire electronic device 600 through various interfaces and lines. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 605, and by invoking the data stored in the memory 605, it executes various functions of the electronic device 600 and processes data. Optionally, the processor 601 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 601 may integrate a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 601 and may be implemented separately by a single chip.

[0088] Among them, the memory 605 may include random access memory (RAM) and may also include read-only memory. Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 605 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store the data involved in the above-mentioned various method embodiments. The memory 605 is optionally also at least one storage device located far from the aforementioned processor 601. As Figure 6 shown, the memory 605, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and application programs.

[0089] In Figure 6In the electronic device 600 shown, the user interface 603 is mainly used to provide an interface for user input and obtain the data input by the user; while the processor 601 can be used to call the application programs stored in the memory 605 and specifically execute as Figure 2 shown in the method, and the specific process can be referred to Figure 2 shown, which will not be elaborated here.

[0090] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory or a random access memory, etc.

[0091] The above-disclosed are only the preferred embodiments of the present application. Of course, the scope of the rights of the present application cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.

Claims

1. A method for locating a memory leak, characterized in that: include: When a memory leak is detected in an embedded device, the type of memory leak is determined; If the type is a continuous leak, after waiting for a first preset time, traverse all memory blocks in the memory and obtain memory information from a memory information storage area of each memory block; wherein the memory block includes a data storage area and a memory information storage area, and the memory information includes a start flag, an end flag, memory size information, memory application time, and memory application function information; Get the memory size and memory request function of each memory block based on memory information; Searching for a memory block having the same memory request function and memory size among all the memory blocks, counting the number of memory blocks that meet the above conditions, and if the number exceeds a preset number, taking the memory block as the target memory block; If the type is function leakage, restart the embedded device; Based on the startup time t0 of the embedded device, the function causing the function leakage in the target code is enabled at time t1; wherein the time interval between time t1 and time t0 is a second preset time length; Traversing all memory blocks in the memory, and obtaining memory application time information in the memory information storage area of each memory block; According to the memory application time information, the memory blocks applied for after time t1 are searched in each memory block, and the found memory blocks are used as target memory blocks.

2. The method according to claim 1, characterized in that The memory information storage area is composed of a memory start flag storage area, a memory size information storage area, a memory application time information storage area, a memory application function information storage area, a data storage area and a memory end flag storage area.

3. The method according to claim 2, characterized in that Traverse all memory blocks in the memory according to the preset memory block allocation record table.

4. The method according to claim 1 or 3, characterized in that Determining the type of memory leak includes: Monitor the changes in the size of free space in memory; When the embedded device is powered on, if the free space gradually decreases to a preset threshold, determining that the type of leakage is a continuous leakage; or When the function of the embedded device is enabled, if the free space in the memory gradually decreases to a preset threshold, it is determined that the type is a function leak.

5. The method according to claim 4, characterized in that Also includes: The number, address and ID of the target memory block are obtained, and the number, address and ID are displayed through a display unit.

6. The method according to claim 5, characterized in that When a memory leak is detected in the embedded device, before determining the type of the memory leak, the method further includes: Run target code in embedded devices; During the execution of the target code, a memory block is allocated or a memory block is released for the target code in the memory.

7. A memory leak location device, characterized in that: The memory leak locating device includes: a determination unit, configured to determine the type of memory leak when a memory leak is detected in the embedded device; a traversal unit, configured to, if the type is a continuous leak, traverse all memory blocks in the memory after waiting for a first preset time period, and obtain memory information from a memory information storage area of each memory block; wherein the memory block includes a data storage area and a memory information storage area, and the memory information includes a start flag, an end flag, memory size information, memory application time, and memory application function information; An acquisition unit, used to acquire the memory size and memory request function of each memory block according to the memory information; a search unit, configured to search for a memory block having the same memory request function and memory size among all the memory blocks, count the number of memory blocks that meet the above conditions, and if the number exceeds a preset number, use the memory block as a target memory block; The search unit is further configured to restart the embedded device if the type is a function leak; Based on the startup time t0 of the embedded device, the function causing the function leakage in the target code is enabled at time t1; wherein the time interval between time t1 and time t0 is a second preset time length; Traversing all memory blocks in the memory, and obtaining memory application time information in the memory information storage area of each memory block; According to the memory application time information, the memory blocks applied for after time t1 are searched in each memory block, and the found memory blocks are used as target memory blocks.

8. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 6.

9. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Memory leak detection method and device and electronic equipment

    CN107423220A

  • Detection and Remediation of Memory Leaks

    US20170308449A1