Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Device and method for detecting memory leak

A memory leak detection device technology, applied in the field of computer programming, can solve problems such as difficult to find, memory leaks, software crashes, etc., and achieve the effect of facilitating program adjustment and enhancing stability

Inactive Publication Date: 2009-09-23
ZTE CORP
View PDF0 Cites 32 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Dynamic allocation of memory can flexibly use limited memory resources, but the problem is memory leaks
For memory leaks, except for using specific tools, it is generally difficult to find
However, memory leaks often cause serious problems such as software crashes.
[0003] The limitation of using specific tools is that these software tools are highly dependent on the CPU chip. If you replace a different chip, you cannot use a dedicated memory testing tool for testing.

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
  • Device and method for detecting memory leak
  • Device and method for detecting memory leak
  • Device and method for detecting memory leak

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0030] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0031] figure 1 A block diagram of a device for detecting memory leaks according to an embodiment of the present invention is shown. Refer to figure 1 , The memory leak detection device 100 of this embodiment includes: an initialization module 102 for initializing log files; a memory management module 104 for performing memory allocation and memory release after the log files are initialized by the initialization module; The recording module 106 is configured to record information about memory allocation and memory release into a log file; and the statistics module 108 is configured to count the number and size of unreleased memory according to the information about memory allocation and memory release.

[0032] The initialization module 102 is also used to determine whether the log file exists, and if it does not exist, create the log file.

[0033] ...

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 device and a method for detecting memory leak. The method comprises the following steps: step S202, after a memory is successfully distributed, updating memory distribution times and recording the memory distribution times and memory distribution information into a log file; step S204, when a parameter pointer is not idle and has been distributed, releasing the memory, updating memory releasing times and size, recording the times and the size into the log file, and deleting the memory distribution information from the log file; and step S206, according to the memory distribution times and the size and the memory releasing times and the size in the log file, determining the times and size of the memory not released. The method can count memory using information, detect incorrect memory release and detect memory leak information, and is quite convenient for a programmer to adjust programs so as to enhance the stability of the programs.

Description

Technical field [0001] The present invention relates to the field of computer programming, and more specifically, is a universal device and method for detecting program memory leaks. Background technique [0002] With the development of embedded technology, more and more fields are applied to embedded technology. In the embedded field, due to the limited resources and performance requirements, programming languages ​​in this field generally use the C language. As we all know, a feature of the C language is the dynamic allocation of memory. Dynamic allocation of memory can flexibly use limited memory resources, but the problem it brings is memory leakage. For memory leaks, it is generally difficult to find out except using specific tools. However, memory leaks often cause serious problems such as software crashes. [0003] The limitation of using specific tools is that these software tools are very dependent on the CPU chip. If you change a different chip, you cannot use a dedicat...

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): G06F9/50G06F11/36
CPCG06F11/073G06F11/0751
Inventor 刘攀
Owner ZTE CORP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products