Method for rapidly positioning memory leak

A technology of memory leak and location method, applied in the field of rapid location of memory leak, can solve the problems of inconvenient location, time-consuming and laborious, high cost, etc., and achieve the effect of convenient and rapid location.

Inactive Publication Date: 2014-07-09
OPZOON TECH
View PDF3 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

If there is a memory leak, the developer needs to spend more time looking at the code and finding the place that has not been released. Therefore, the memory leak problem has always been a major problem that plagues the developer's positioning problem, and often requires the developer to spend a lot of time to find out. Where memory leaks, time-consuming and labor-intensive
Technical problems of this technology: need t

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for rapidly positioning memory leak

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0043] Assume that the address of the function named function1() is 0x00000001, and the line number in the code corresponding to this function is LINE:10021.

[0044] When this function applies for memory, it applies for an extension area of ​​a predetermined size in the memory to store memory header information. The memory header information includes: header identification information and function information, where the header identification information is set as the magic number of the memory header " 00", which is used to indicate that the memory is used and not released; the function information includes the function address 0x00000001 and the corresponding code line number LINE: 10021, and the function address 0x00000001 can be translated into the function name function1() of the function.

[0045] Preferably, the extension area also stores memory tail information, and the memory tail information includes: tail identification information for confirming the end position of ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method for rapidly positioning memory leak. The method includes steps of S1 applying for an extension area with a predetermined size in a memory when the memory is applied for, wherein the extension area is used for saving memory header information; S2, initializing the header information into a first identifier and saving function information calling the application memory; S3, adding the memory to a memory chain table; S4, arranging the header identifier information as a third identifier when the applied memory is released and saving function information for calling the released memory; S5, deleting the released memory from the memory chain table; S6, traversing the memory chain table when the memory leak needs positioning, and counting times of memory application of the same functions according to the function information, wherein the function with the continuously increased times for memory application is a function with memory leak. By means of the method for rapidly positioning the memory leak, specific functions and code lines with memory leak can be clearly displayed from more to less or from less to more according to memory application times of the functions, and rapid positioning is achieved.

Description

technical field [0001] The invention relates to the field of memory management, in particular to a method for quickly locating memory leaks. Background technique [0002] In today's IT industry, one of the most frequent operations in code development is the application and release of memory. If the memory is not released in time after the application, and this happens frequently, the remaining memory will continue to decrease, and the available memory will gradually decrease. This situation is usually called a memory leak. If there is a memory leak, the developer needs to spend more time looking at the code and finding the place that has not been released. Therefore, the memory leak problem has always been a major problem that plagues the developer's positioning problem, and often requires the developer to spend a lot of time to find out. Where there is a memory leak, it is time-consuming and labor-intensive. An existing method for locating memory leaks is as follows: firs...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F11/36
Inventor 赵众
Owner OPZOON TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products