Memory leakage detection and prevention method

A memory leak and memory block technology, which is applied in the field of memory leak detection and prevention, can solve problems such as memory leaks, no leak prevention, and memory leaks that cannot be detected, so as to eliminate unnecessary detection and prevent false detection.

Inactive Publication Date: 2006-10-11
HUAWEI TECH CO LTD
View PDF1 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The essence of above-mentioned prior art scheme is to determine the leak of memory block by adopting the detection module that increases, but has following defect: can only detect the memory

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
  • Memory leakage detection and prevention method
  • Memory leakage detection and prevention method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0020] The memory leak detection and prevention method of the present invention can detect memory block leaks, record the detection results to facilitate problem location and inspection, and then judge whether to release the memory block according to the detection results; or directly perform release recovery when a memory block leak is found to prevent system deterioration , improve the stability of the system running for a long time.

[0021] The messages in the system are all time-sensitive. Messages that have not been processed for more than a certain period of time are invalid, and the allocated memory blocks are judged as leaks and can be released.

[0022] Please refer to figure 1 , according to the principle, the method for memory leak detection of the present invention comprises:

[0023] The setting step is, in the operating system, adding a time stamp for recording the occupied time of the memory block;

[0024] In the assignment step, when the memory management m...

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 relates to a method for detecting and avoiding memory leakage, which comprises: setting step that increasing a time label in the operation system to record the time that memory is occupied; evaluating step that memory manage module evaluates the time label when distributing memory blocks to record the system time that distributing said memory block and refreshing the value of time label into present system time when accessing the memory block; checking step that checking the time label of memory block; judging step that judging if the memory block occupy time is longer than the forced release time according to the time recorded in time label, and if it is longer, the memory block is leaked, or else, the memory block is not leaked. The invention can effectively judge if the memory block should be released, and directly release memory block when the leakage is detected.

Description

technical field [0001] The invention relates to memory management of a computer system, in particular to a method for detecting and preventing memory leaks. Background technique [0002] Memory is a necessary resource for the software to run. Insufficient memory resources will cause the software to run abnormally, and the system cannot provide normal functions or even exit the service. Especially in the message processing-oriented software architecture, each process communicates through messages, and it is necessary to allocate a suitable memory block for each message to cache the message content, and release the memory block after the message is sent. During the long-term running of the software, the allocated memory may not be released due to various reasons, resulting in memory leaks, and the cumulative effect may lead to the reduction or even exhaustion of the total system memory. In this case, the system generally cannot recover by itself, and in severe cases, it may l...

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 HUAWEI TECH CO LTD
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