System and method for judging memory leak

A memory leak and memory technology, applied in the field of systems for judging memory leaks, can solve problems such as tedious analysis work

Active Publication Date: 2010-12-08
BEIJING HAITAI FANGYUAN HIGH TECH
View PDF4 Cites 36 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The problem currently existing in this invention is that since the memory allocation and release information output to the log file and the number and size of unreleased memory are arranged out of order, if there is a large amount of the above information, the programmer needs to perform a lot of tedious analysis Work

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
  • System and method for judging memory leak
  • System and method for judging memory leak
  • System and method for judging memory leak

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0033] The following takes the C language application program as an example, combined with figure 1 A system for judging memory leaks provided by the present invention is described in detail.

[0034] Such as figure 1 As shown, a system for judging memory leaks provided by the present invention is mainly composed of an initialization module 101 , a management module 102 , a statistics module 103 and an output module 104 . in:

[0035] The initialization module 101 is used to initially define a space type, and define a space according to the space type. The space defined according to this space type is used to record the name of the function that applies for memory in the program, the size of the memory applied by the function, and the number of memory applications that have not been released.

[0036] The management module 102 is used to determine whether the functions in the program apply for or release memory.

[0037] The statistical module 103 is used to count the memo...

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 provides a method for judging memory leak, comprising the following steps of: when a function application memory is judged aiming at each function in a program, accumulating the memory capacity and the application times of the named function application; when a function release memory is judged, reducing the released memory capacity from the memory capacity of the named function accumulated application and reducing release memory times from accumulated application times; sequencing the memory capacity and the times of the function application in different names in a descending mode by using the memory capacity as priority; ensuring and outputting a level of a memory leak degree according to the memory capacity and the times of the function accumulated application in different names; in addition, the invention provides a system for realizing the method in order to sequence memory distribution and information release according to the memory application times and liberate a programmer from large fussy analytical work.

Description

technical field [0001] The invention relates to a system and method for judging memory leaks. Background technique [0002] Simply put, a memory leak is to apply for a piece of memory space and not release it after use. Its general manifestation is that the longer the program runs, the more memory it takes up, and eventually all memory is used up, and the entire system crashes. Generally, the memory leak we often refer to refers to the leak of heap memory. Heap memory means that the program allocates from the heap, and the size is arbitrary (the size of the memory block can be determined during the program runtime), and the freed memory must be displayed after use. C language applications generally use functions such as malloc, realloc, and new to allocate a block of memory from the heap. After use, the program must be responsible for calling free or delete to release the memory block, otherwise, the memory cannot be used again , that is, this piece of memory leaks. [0...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
Inventor 邱海燕
Owner BEIJING HAITAI FANGYUAN HIGH 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