WO2017035785A1 - Procédé et appareil pour localiser une fuite de mémoire - Google Patents

Procédé et appareil pour localiser une fuite de mémoire Download PDF

Info

Publication number
WO2017035785A1
WO2017035785A1 PCT/CN2015/088764 CN2015088764W WO2017035785A1 WO 2017035785 A1 WO2017035785 A1 WO 2017035785A1 CN 2015088764 W CN2015088764 W CN 2015088764W WO 2017035785 A1 WO2017035785 A1 WO 2017035785A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
information
program
recording space
application
Prior art date
Application number
PCT/CN2015/088764
Other languages
English (en)
Chinese (zh)
Inventor
陈千伍
Original Assignee
深圳好视网络科技有限公司
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 深圳好视网络科技有限公司 filed Critical 深圳好视网络科技有限公司
Priority to PCT/CN2015/088764 priority Critical patent/WO2017035785A1/fr
Publication of WO2017035785A1 publication Critical patent/WO2017035785A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the invention belongs to the field of software, and in particular relates to a method and device for locating a memory leak.
  • the code executed by the program and the data segment that needs to be used in the execution process are usually stored in the memory, thereby quickly executing the program code and efficiently reading the data in the data segment. .
  • the memory leak refers to a situation in which the program fails to release the memory that is no longer used due to negligence or error. Memory leak does not mean that the memory disappears physically. Instead, after the application allocates a certain amount of memory, it loses control of the memory due to programming errors or other reasons, thus causing memory waste.
  • Heap memory refers to the program is allocated from the heap, the size is arbitrary (the size of the memory block can be determined at the running time of the program), and the released memory must be displayed after use.
  • Application is generally used Malloc, realloc, new and other functions are allocated from the heap to a block of memory. After use, the program must be responsible for the corresponding call free or delete. The memory block is released. Otherwise, the memory cannot be used again, that is, the memory leak occurs.
  • the total memory occupied by the program is generally monitored in real time.
  • the current program is considered to have a memory leak, and the fault is located through the memory check.
  • This method requires a lot of effort in locating the location of the memory leak, and the location of the memory leak is inefficient.
  • an embodiment of the present invention provides a method for locating a memory leak, where the method includes:
  • the memory required to be requested according to the program code, and the preset recording space consecutive to the address of the memory to be applied, constitute the actually allocated memory, and the requested memory information is recorded in the recording space.
  • the memory information requested in the corresponding recording space is searched and updated according to the released memory, and the memory information of the application in the recording space is updated to the tracking file;
  • the memory leak location is performed according to the memory information of the application recorded by the trace file and the code location information.
  • the program code is configured by a plurality of different program files, and before the memory application step, the method further includes:
  • mapping result of the mapping operation is updated according to the mapping operation.
  • the step of recording the requested memory information and the code location information in the recording space includes:
  • Recording a program file name for requesting memory, a program line number for requesting memory, and a size of the application memory are recorded at a predetermined position in the memory segment of the preset length.
  • the step of recording the requested memory information and the code location information in the recording space includes:
  • the newly applied memory value is added to the memory information requested in the recording space.
  • the updating, in the memory space, the memory information in the recording space, and updating the memory information of the application in the recording space to the The steps to track files include:
  • the released memory is all the memory in the requested memory information in the recording space, the data of the recording space is deleted and the memory corresponding to the recording space is released, and the memory information requested in the updated tracking file is 0. Or deleting the record information of the program line number in the trace file;
  • the memory information requested in the recording space is subtracted from the released memory value, and the result of the subtraction is updated to the trace file.
  • an embodiment of the present invention provides a memory leak location device, where the device includes:
  • the memory application unit is configured to, in each memory application, a memory that needs to be applied according to the program code, and a preset recording space that is continuous with the address of the memory that needs to be applied, to constitute an actually allocated memory, in the recording space. Recording the memory information and code location information of the application, and writing the memory information and code location information of the application into the tracking file;
  • a memory release unit configured to: according to the released memory, find and update the memory information requested in the corresponding recording space, and update the memory information of the application in the recording space to the trace file.
  • a positioning unit configured to perform memory leak location according to the memory information of the application recorded by the trace file and the code location information.
  • the device further includes:
  • a location mapping unit configured to perform mapping operations on the program file, and establish a mapping relationship between the mapping result of the mapping operation and the storage location in the trace file;
  • the location mapping update unit is configured to update, according to the mapping operation, a correspondence between a mapping result of the mapping operation and a storage location of the trace file, after the program file is modified.
  • the memory application unit includes:
  • the memory application determining subunit is configured to determine whether the program line number of the current program file has applied for memory
  • a memory segment obtaining subunit configured to acquire a memory segment of a preset length, the address of the memory segment, and the program, if the program line number of the current program file does not apply for memory, before the program code needs to apply for the memory address
  • the address of the memory that the code needs to apply is continuous;
  • the program information recording subunit is configured to record, in a predetermined position in the memory segment of the preset length, a program file name that needs to apply for a memory, a program line number that needs to apply for a memory, and a size of the application memory.
  • the memory application unit includes:
  • the memory application determining subunit is configured to determine whether the program line number of the current program file has applied for memory
  • the memory value accumulates the subunit for accumulating the newly applied memory value into the memory information requested in the recording space if the program line number of the current program file has already applied for memory.
  • the memory release unit includes:
  • a memory release determining subunit configured to determine whether the released memory is all memory in the memory information of the application in the recording space
  • a recording space release subunit configured to: if the released memory is all memory in the requested memory information in the recording space, delete the data of the recording space and release the memory corresponding to the recording space, and update the tracking correspondingly
  • the memory information requested in the file is 0 or delete the record information of the program line number in the trace file;
  • a recording space update subunit configured to: if the released memory is not all the memory in the requested memory information in the recording space, subtract the memory information requested in the recording space from the released memory value, and subtract the same The result is updated to the trace file.
  • Space when the memory is released, according to the positional relationship between the recording space and the applied memory, the released memory information is updated to the recording space, and the information of the recording space is displayed by the trace file, so that the user can quickly find the leaked memory. Size and position corresponding to positioning, improve the positioning efficiency of memory leaks.
  • FIG. 1 is an implementation flow of a method for locating a memory leak according to a first embodiment of the present invention
  • FIG. 2 is a flowchart for implementing a method for establishing a correspondence relationship between a program file and a storage location in a trace file according to a second embodiment of the present invention
  • FIG. 3 is an implementation flow of a method for locating a memory leak according to a third embodiment of the present invention.
  • FIG. 4 is an implementation flow of a method for locating a memory leak according to a fourth embodiment of the present invention.
  • FIG. 5 is a flowchart showing an implementation process of a memory leak location method according to a fifth embodiment of the present invention.
  • FIG. 6 is a flowchart showing an implementation process of a memory leak location method according to a sixth embodiment of the present invention.
  • the purpose of the embodiments of the present invention is to solve the problem of low memory leak location efficiency when running an application in the prior art. Because the code in the application will call repeated memory or release, due to programmer negligence or other reasons, the program calls too much memory, but does not release the memory in time, causing memory leaks, which makes up too much system resources, affecting other The normal operation of the program.
  • the prior art positioning method In order to efficiently perform memory leak location, the prior art positioning method generally determines whether a memory leak occurs by monitoring the total memory usage of the application, and further locates the memory leak according to the running logic of the program. The positioning speed is slow and it is not easy to accurately locate the location of the memory leak. To overcome this problem, the following detailed description will be made with reference to the accompanying drawings.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • FIG. 1 is a flowchart showing an implementation process of a memory leak location method according to a first embodiment of the present invention, which is described in detail as follows:
  • step S101 In each memory application, the memory required to be applied according to the program code, and the preset recording space continuous with the address of the memory to be applied, constitute the actually allocated memory, and the application is recorded in the recording space. Memory information and code location information, and write the memory information and code location information of the application to the trace file.
  • the memory application and the memory release described in the embodiment of the present invention can be understood as a memory application proposed by the application when executed.
  • a memory application proposed by the application when executed.
  • use malloc , realloc , new and other functions are allocated from the heap to a block of memory, after use, the program must be responsible for the corresponding call free or delete Release the memory block.
  • information including the size of the memory to be applied for, or information on whether or not to further increase the memory space is included.
  • the program code described in the embodiment of the present invention that is, the program statement of the application program.
  • the process of executing the statements constituting the application is executed repeatedly.
  • the memory application statement in the application is executed, the memory is allocated for the application, and when the execution of the memory release statement is executed, the application is released.
  • the specified location or the memory space of the specified data is not limited to the program statement of the application program.
  • the recording space described in the embodiment of the present invention refers to an additional memory segment in the embodiment of the present invention when the application program is executed to the code location under normal conditions, and the memory application is presented to the system and the memory allocated by the system is obtained.
  • the memory allocation is generally a contiguous address
  • the added memory address of the memory segment is continuous with the address of the requested memory.
  • the preferred implementation manner is: setting the address of the added memory segment before the address of the applied memory, so that the subsequent application memory can be continued after the requested memory.
  • the accumulation makes the application of memory continuous storage.
  • the address of the recording space is set before the address of the memory of the application, and when the memory is released later, the recording space can be found according to the starting position of the memory occupied by the program code.
  • the actually allocated memory includes two parts, that is, the memory occupied by the program code and the memory occupied by the recording space.
  • the size of the recording space is generally preset. For example, according to the type of information that needs to be recorded in the recording space, the memory size of the recording space can be set accordingly.
  • the actually allocated memory consists of two parts, the recording space and the requested memory, where the recording space includes the file name and the program line number.
  • the size of the memory required for the recording space can be determined based on the maximum space occupied by the name and the maximum space occupied by the program line number.
  • the recording space includes the requested memory information and code location information, where the memory information of the application may be the size of the applied memory, such as an application. 128 bytes of memory, if the size of the memory occupied by the record space is 64 bytes, then the system will return a continuous 192 bytes of memory space according to the request of the memory request, in the first 64
  • the memory information and code location information used as the recording space storage request in the bytes are used as data storage in the program code in the last 128 bytes.
  • Location information of the code an application composed of a plurality of program files (in practice, a general application is composed of a plurality of program files), may include the name of the program file, and be in the same application The names of any two program files are not the same.
  • the embodiment of the present invention is used for locating a memory leak, and the location information of the code further includes a line number of the application. In the same application, the line number corresponding to each line of the program code is unique.
  • the size of the memory used in the specific location of the application code can be accurately located.
  • code position information is only one of the better representations by the name of the program file and the program line number.
  • the representation of the code position information of the present application is not limited to the above one.
  • the application further includes updating the information of the record space record to the trace file, including information such as a program file name, a program line number, and a memory size corresponding to the memory.
  • the trace file may be a text file generated when the application is executed, and stored in a non-volatile memory, and the program file corresponding to the memory allocation in the file and the program may still be viewed after the program is restarted or powered off. Line number.
  • the generation of the trace file may be performed each time the memory application is executed in the application and step S102
  • the memory described in the memory is released into the information of the recording space before the memory address of the application is printed, and the information of the recording space is updated to the tracking file.
  • step S102 In each memory release, the memory information requested in the corresponding recording space is searched for and updated according to the released memory, and the memory information of the application in the recording space is updated to the trace file.
  • the memory release described in the embodiment of the present invention can be understood as a memory application proposed by the application when it is executed. For example, when the application is executing, use free or delete Release the memory block.
  • the start address of the released memory is received, and according to the start address and the size of the preset recording space, the start address and the end address of the record space can be determined correspondingly (all of the program line numbers are released)
  • the end address of the recording space is continuous with the start address of the address of the application. According to the address of the recording space, it is possible to view the information of the memory of the corresponding application recorded in the recording space and the line number corresponding to the statement of the application for memory.
  • the corresponding update of the information in the record space in the memory release, generally only need to update the memory information requested in the record space (of course, the record space will be deleted when all released)
  • the recorded information can be updated to the tracking file by printing or other means.
  • a step S101 and a step S102 Execution does not need to be performed in strict accordance with the sequence, and the corresponding execution steps can be selected according to the program statements required for execution. For example, if the memory release statement is encountered, step S102 is executed, and when the memory application statement is encountered, step S101 is performed. .
  • step S103 memory leak location is performed according to the memory information of the application recorded by the trace file and the code location information.
  • the information recorded in the trace file in the embodiment of the present invention can be found in each memory application and each memory release, and when the memory is released, the corresponding row position of the corresponding memory application statement can be found, thereby being fast. Effectively determine the specific location of the memory application and improve the positioning efficiency of the deposit leak.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • figure 2 The implementation flow of the method for establishing a storage location correspondence relationship between the program file and the trace file provided by the second embodiment of the present invention is shown, which can be applied to the memory application step or the memory release step in the first embodiment.
  • the program code is composed of a plurality of different program files, and the method is detailed as follows:
  • step S201 The mapping operation is performed on the program file, and the mapping relationship between the mapping result of the mapping operation and the storage location in the trace file is established.
  • the present application further includes establishing a correspondence between the mapping result and the storage location of the trace file.
  • the mapping operation described in the embodiment of the present invention may be performed by using a hash algorithm.
  • the hash algorithm can map binary values of arbitrary length into shorter fixed-length binary values, and the shorter binary values are called hash values.
  • a hash value is a unique and extremely compact numerical representation of a piece of data. If you hash a plaintext and even change only one letter of the paragraph, subsequent hashes will produce different values. It is computationally impossible to find two different inputs that are hashed to the same value.
  • the mapping operation may further include: mapping the program file and the line number of the program, and when the program line number is used for the memory application, causing the memory operation of the same line of the same program file. The information is automatically updated to the same location.
  • step S202 After the program file is modified, the correspondence between the mapping result of the mapping operation and the storage location of the trace file is updated according to the mapping operation.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • FIG. 3 shows an implementation flow provided by a third embodiment of the present invention, which is described in detail as follows:
  • step S301 In each memory application, the memory that needs to be applied according to the program code, and the preset recording space that is continuous with the address of the memory that needs to be applied, constitute the actually allocated memory.
  • step S302 it is determined whether the program line number of the current program file has applied for memory.
  • the purpose of determining whether to apply for the line number for the first time is to determine whether it is necessary to allocate a memory segment corresponding to the recording space according to the judgment result.
  • step S303 If the program line number of the current program file does not apply for memory, before the program code needs to apply for the memory address, obtain a memory segment of a preset length, the address of the memory segment and the memory of the program code to be applied for. The address is continuous.
  • the memory segment corresponding to the recording space needs to be allocated, and the information about the memory application is recorded in the recording space, including the program file name, the program line number for which the memory needs to be applied, and The size of the application memory.
  • step S304 The program file name of the memory to be applied for, the program line number of the memory to be applied for, and the size of the application memory are recorded in a predetermined position in the memory segment of the preset length.
  • the acquisition needs to be released.
  • the record space is found according to the address, so that the program file and the program line number of the application memory can be found, and the information in the trace file is modified according to the location of the found memory application.
  • step S305 In each memory release, the memory information requested in the corresponding recording space is searched for and updated according to the released memory, and the memory information of the application in the recording space is updated to the trace file.
  • step 306 memory leak location is performed according to the memory information of the application recorded by the trace file and the code location information.
  • the embodiment of the present invention introduces a method for setting a recording space when a new memory is applied.
  • the program file name and the program line number of the corresponding memory application can be found when the memory is released, which can be more effective for each
  • the memory in the program line number of the memory application is managed and monitored.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • FIG. 4 is a flowchart showing an implementation process of a memory leak location method according to a fourth embodiment of the present invention, which is described in detail as follows:
  • step S401 In each memory application, the memory that needs to be applied according to the program code, and the preset recording space that is continuous with the address of the memory that needs to be applied, constitute the actually allocated memory.
  • step S402 it is determined whether the program line number of the current program file has applied for memory.
  • step S403 If the program line number of the current program file has already applied for memory, the newly applied memory value is added to the memory information requested in the recording space.
  • the newly added memory is generally after the previously applied memory, and the previously applied memory and The newly added memory address is continuous. That is, when the first memory application is made, an expandable memory space is reserved for subsequent increased memory usage.
  • step S404 In each memory release, the memory information requested in the corresponding recording space is searched for and updated according to the released memory, and the memory information of the application in the recording space is updated to the trace file.
  • the memory leak location is performed according to the memory information of the application recorded by the trace file and the code location information.
  • the embodiment of the present invention and the third embodiment are descriptions of two different situations when the program code is executed.
  • the memory application is applied again to the program code that has applied for the recording space, only the data of the memory information in the recording space needs to be updated and updated. The data is updated accordingly to the trace file.
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • FIG. 5 is a flowchart showing an implementation process of a memory leak location method according to a fifth embodiment of the present invention, which is described in detail as follows:
  • step S501 In each memory application, the memory required to be applied according to the program code, and the preset recording space continuous with the address of the memory to be applied, constitute the actually allocated memory, and the application is recorded in the recording space. Memory information and code location information, and write the memory information and code location information of the application to the trace file.
  • step S502 it is determined whether the released memory is all of the memory in the requested memory information in the recording space.
  • memory release there are generally two cases, one is to release all the memory in the memory of the same program line number application, and the other is to release part of the memory when the same program line number is applied for memory multiple times.
  • step S503 If the released memory is all the memory in the memory information of the application in the recording space, delete the data of the recording space and release the memory corresponding to the recording space, and update the memory information applied in the tracking file accordingly. Is 0 Or deleting the record information of the program line number in the trace file.
  • the data of the recording space may be deleted, or the memory corresponding to the recording space may be directly released.
  • the data information corresponding to the program line number may be deleted, or the memory size in the data information corresponding to the program line number may be changed to 0.
  • step S504 If the released memory is not all of the memory in the requested memory information in the recording space, the memory information requested in the recording space is subtracted from the released memory value, and the subtracted result is updated to the tracking. file.
  • the method can obtain the data of the recording space according to the forwarded memory. And update the data value of the record space accordingly.
  • the memory leak location is performed according to the memory information of the application recorded by the trace file and the code location information.
  • the corresponding data manner for finding and updating the recording space is specifically introduced, and the search space is quickly and efficiently searched and updated for the manner of releasing the memory part and releasing all the memory.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • FIG. 4 is a flowchart showing an implementation process of a memory leak location method according to a fourth embodiment of the present invention, which is described in detail as follows:
  • step S401 In each memory application, the memory that needs to be applied according to the program code, and the preset recording space that is continuous with the address of the memory that needs to be applied, constitute the actually allocated memory.
  • step S402 it is determined whether the program line number of the current program file has applied for memory.
  • step S403 If the program line number of the current program file has already applied for memory, the newly applied memory value is added to the memory information requested in the recording space.
  • the newly added memory is generally after the previously applied memory, and the previously applied memory and The newly added memory address is continuous. That is, when the first memory application is made, an expandable memory space is reserved for subsequent increased memory usage.
  • step S404 In each memory release, the memory information requested in the corresponding recording space is searched for and updated according to the released memory, and the memory information of the application in the recording space is updated to the trace file.
  • the memory leak location is performed according to the memory information of the application recorded by the trace file and the code location information.
  • the embodiment of the present invention and the third embodiment are descriptions of two different situations when the program code is executed.
  • the memory application is applied again to the program code that has applied for the recording space, only the data of the memory information in the recording space needs to be updated and updated. The data is updated accordingly to the trace file.
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • FIG. 5 is a flowchart showing an implementation process of a memory leak location method according to a fifth embodiment of the present invention, which is described in detail as follows:
  • step S501 In each memory application, the memory required to be applied according to the program code, and the preset recording space continuous with the address of the memory to be applied, constitute the actually allocated memory, and the application is recorded in the recording space. Memory information and code location information, and write the memory information and code location information of the application to the trace file.
  • step S502 it is determined whether the released memory is all of the memory in the requested memory information in the recording space.
  • memory release there are generally two cases, one is to release all the memory in the memory of the same program line number application, and the other is to release part of the memory when the same program line number is applied for memory multiple times.
  • step S503 If the released memory is all the memory in the memory information of the application in the recording space, delete the data of the recording space and release the memory corresponding to the recording space, and update the memory information applied in the tracking file accordingly. Is 0 Or deleting the record information of the program line number in the trace file.
  • the data of the recording space may be deleted, or the memory corresponding to the recording space may be directly released.
  • the data information corresponding to the program line number may be deleted, or the memory size in the data information corresponding to the program line number may be changed to 0.
  • step S504 If the released memory is not all of the memory in the requested memory information in the recording space, the memory information requested in the recording space is subtracted from the released memory value, and the subtracted result is updated to the tracking. file.
  • the method can obtain the data of the recording space according to the forwarded memory. And update the data value of the record space accordingly.
  • the memory leak location is performed according to the memory information of the application recorded by the trace file and the code location information.
  • the corresponding data manner for finding and updating the recording space is specifically introduced, and the search space is quickly and efficiently searched and updated for the manner of releasing the memory part and releasing all the memory.
  • FIG. 6 is a schematic structural diagram of a memory leak location device according to an embodiment of the present invention, which is described in detail as follows:
  • Memory application unit 601 For each memory application, the memory to be applied according to the program code, and the preset recording space continuous with the address of the memory to be applied, constitute the actually allocated memory, and the application is recorded in the recording space. Memory information and code location information, and writing the memory information and code location information of the application into the tracking file;
  • Memory release unit 602 And, for each memory release, searching and updating the memory information requested in the corresponding recording space according to the released memory, and updating the memory information of the application in the recording space to the tracking file;
  • Positioning unit 603 And performing memory leak location according to the memory information of the application recorded by the trace file and the code location information.
  • the device further comprises:
  • a location mapping unit configured to perform mapping operations on the program file, and establish a mapping relationship between the mapping result of the mapping operation and the storage location in the trace file;
  • the location mapping update unit is configured to update, according to the mapping operation, a correspondence between a mapping result of the mapping operation and a storage location of the trace file, after the program file is modified.
  • the memory application unit comprises:
  • the memory application determining subunit is configured to determine whether the program line number of the current program file has applied for memory
  • a memory segment obtaining subunit configured to acquire a memory segment of a preset length, the address of the memory segment, and the program, if the program line number of the current program file does not apply for memory, before the program code needs to apply for the memory address
  • the address of the memory that the code needs to apply is continuous;
  • the program information recording subunit is configured to record, in a predetermined position in the memory segment of the preset length, a program file name that needs to apply for a memory, a program line number that needs to apply for a memory, and a size of the application memory.
  • the memory application unit comprises:
  • the memory application determining subunit is configured to determine whether the program line number of the current program file has applied for memory
  • the memory value accumulates the subunit for accumulating the newly applied memory value into the memory information requested in the recording space if the program line number of the current program file has already applied for memory.
  • the memory release unit comprises:
  • a memory release determining subunit configured to determine whether the released memory is all memory in the memory information of the application in the recording space
  • a recording space release subunit configured to: if the released memory is all memory in the requested memory information in the recording space, delete the data of the recording space and release the memory corresponding to the recording space, and update the tracking correspondingly
  • the memory information requested in the file is 0 or delete the record information of the program line number in the trace file;
  • a recording space update subunit configured to: if the released memory is not all the memory in the requested memory information in the recording space, subtract the memory information requested in the recording space from the released memory value, and subtract the same The result is updated to the trace file.
  • the device for locating a memory leak according to the embodiment of the present invention corresponds to the method for locating a memory leak according to the first embodiment to the fifth embodiment, and details are not described herein.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory )
  • ROM read-only memory
  • RAM Random Access Memory

Abstract

L'invention concerne un procédé pour localiser une fuite de mémoire. Le procédé consiste : lors de chaque demande de mémoire, selon une mémoire ayant besoin d'être demandée par un code de programme et un espace d'enregistrement préréglé, à constituer une mémoire réellement distribuée, et enregistrer des informations concernant la mémoire demandée et des informations de position de code dans l'espace d'enregistrement et écrire ces dernières dans un fichier de trace (S101) ; lors de chaque libération de mémoire, selon la mémoire libérée, à rechercher et mettre à jour les informations concernant la mémoire demandée dans l'espace d'enregistrement correspondant, et mettre à jour les informations concernant la mémoire demandée dans l'espace d'enregistrement au fichier de trace (S102) ; et selon les informations concernant la mémoire demandée et les informations de position de code enregistrées dans le fichier de trace, à localiser une fuite de mémoire (S103). Par réglage d'un espace d'enregistrement, et recherche de l'espace d'enregistrement correspondant lorsqu'une mémoire est libérée, des données de mémoire sont mises à jour, et mises à jour de manière correspondante à un fichier de trace, ainsi, un utilisateur peut localiser rapidement et de manière précise une position d'une fuite de mémoire, et l'efficacité de localisation de la fuite de mémoire est améliorée.
PCT/CN2015/088764 2015-09-01 2015-09-01 Procédé et appareil pour localiser une fuite de mémoire WO2017035785A1 (fr)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/088764 WO2017035785A1 (fr) 2015-09-01 2015-09-01 Procédé et appareil pour localiser une fuite de mémoire

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/088764 WO2017035785A1 (fr) 2015-09-01 2015-09-01 Procédé et appareil pour localiser une fuite de mémoire

Publications (1)

Publication Number Publication Date
WO2017035785A1 true WO2017035785A1 (fr) 2017-03-09

Family

ID=58186545

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/088764 WO2017035785A1 (fr) 2015-09-01 2015-09-01 Procédé et appareil pour localiser une fuite de mémoire

Country Status (1)

Country Link
WO (1) WO2017035785A1 (fr)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110618928A (zh) * 2019-06-25 2019-12-27 北京无限光场科技有限公司 一种内存泄露检测方法、装置、终端设备及介质
CN110908865A (zh) * 2019-11-15 2020-03-24 珠海豹趣科技有限公司 内存泄漏监控方法、装置及电子设备
CN113157477A (zh) * 2021-04-14 2021-07-23 北京字节跳动网络技术有限公司 内存泄漏的归因方法、装置、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050235127A1 (en) * 2004-04-19 2005-10-20 Cisco Technology, Inc. Method and system for memory leak detection
CN101110044A (zh) * 2007-08-28 2008-01-23 中兴通讯股份有限公司 一种内存监控管理的方法及系统
CN101539870A (zh) * 2008-03-21 2009-09-23 中兴通讯股份有限公司 内存泄漏检测装置及方法
CN101763305A (zh) * 2009-12-29 2010-06-30 青岛海信宽带多媒体技术有限公司 一种嵌入式系统内存泄露的检测方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050235127A1 (en) * 2004-04-19 2005-10-20 Cisco Technology, Inc. Method and system for memory leak detection
CN101110044A (zh) * 2007-08-28 2008-01-23 中兴通讯股份有限公司 一种内存监控管理的方法及系统
CN101539870A (zh) * 2008-03-21 2009-09-23 中兴通讯股份有限公司 内存泄漏检测装置及方法
CN101763305A (zh) * 2009-12-29 2010-06-30 青岛海信宽带多媒体技术有限公司 一种嵌入式系统内存泄露的检测方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110618928A (zh) * 2019-06-25 2019-12-27 北京无限光场科技有限公司 一种内存泄露检测方法、装置、终端设备及介质
CN110908865A (zh) * 2019-11-15 2020-03-24 珠海豹趣科技有限公司 内存泄漏监控方法、装置及电子设备
CN113157477A (zh) * 2021-04-14 2021-07-23 北京字节跳动网络技术有限公司 内存泄漏的归因方法、装置、电子设备和存储介质
CN113157477B (zh) * 2021-04-14 2024-02-06 北京字节跳动网络技术有限公司 内存泄漏的归因方法、装置、电子设备和存储介质

Similar Documents

Publication Publication Date Title
WO2014208863A1 (fr) Appareil et procédé de gestion de données intégrée pour cache de tampon non volatil et dispositif de stockage non volatil
WO2014032262A1 (fr) Procédé et système d'implémentation pour migration d'application entre des plateformes
WO2015020471A1 (fr) Procédé et appareil de distribution de données dans un environnement en nuage hybride
WO2017035785A1 (fr) Procédé et appareil pour localiser une fuite de mémoire
WO2018076868A1 (fr) Procédé, dispositif et système de synchronisation de données, support de stockage et serveur
WO2015005634A1 (fr) Système mémoire et procédé de contrôle de celui-ci
WO2013016979A1 (fr) Procédé et système de vérification de puce soc
WO2018101640A1 (fr) Procédé de récupération de cohérence pour duplication de base de données transparente
WO2018076889A1 (fr) Procédé de sauvegarde de données, dispositif, système, support de stockage et serveur
WO2013174210A1 (fr) Procédé et dispositif de stockage de données dans un dispositif à mémoire flash
WO2016204529A1 (fr) Dispositif et procédé de stockage en mémoire destinés à la prévention de perte de données après une perte d'alimentation électrique
WO2015102220A1 (fr) Système de stockage ayant un dispositif de stockage de sécurité et procédé de gestion correspondant
WO2018233369A1 (fr) Procédé d'écriture basé sur la copie sur écriture et dispositif de disque virtuel, et support de stockage
WO2018076812A1 (fr) Procédé et dispositif de réponse à une demande de données, support de stockage, serveur et système
WO2018076867A1 (fr) Procédé, dispositif et système de suppression de sauvegarde de données, support de mémoire et serveur
WO2018076829A1 (fr) Serveur, support d'informations, système, appareil et procédé de traitement de données de terminal
WO2017082520A1 (fr) Système de gestion de base de données et son procédé de modification et de récupération de données
WO2021012481A1 (fr) Procédé et appareil de surveillance de performances de système, dispositif et support d'informations
WO2015002481A1 (fr) Appareil et procédé de gestion de tampon à trois états sur la base d'une mémoire flash
WO2020253125A1 (fr) Procédé, appareil et dispositif de gestion de journal et support d'informations
WO2019205272A1 (fr) Procédé, dispositif et équipement de fourniture de service de machine virtuelle, et support d'informations lisible par ordinateur
WO2021080385A1 (fr) Dispositif informatique et procédé de fonctionnement associé
WO2018076869A1 (fr) Procédé sauvegarde de données, appareil, support de stockage et dispositif électronique
WO2018076872A1 (fr) Procédé et appareil de sauvegarde de données, support de stockage et serveur
WO2015180434A1 (fr) Procédé de gestion de données, nœud et système pour grappe de bases de données

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15902592

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15902592

Country of ref document: EP

Kind code of ref document: A1