Unlock instant, AI-driven research and patent intelligence for your innovation.

Method for preventing memory leak

A memory leak and release memory technology, applied in the software field, can solve problems such as unresolvable memory and leaks, and achieve the effect of reducing memory leaks

Inactive Publication Date: 2010-07-07
PEKING UNIV +1
View PDF2 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The above two methods only improve the method of judging whether the memory is leaking, but they cannot solve the problem of memory leaking for the abnormal situation of partial program crash.

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 preventing memory leak
  • Method for preventing memory leak
  • Method for preventing memory leak

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0024] Such as figure 1 As shown, a method for preventing memory leaks includes the following steps:

[0025] (1) Create an access proxy object 11: create a corresponding access proxy object while creating the actual object;

[0026] (2) Establishing access relationship 12: accessing the actual object through the corresponding access proxy object;

[0027] (3) release access proxy object pointer 13: release the pointer of the access proxy object to the actual object;

[0028] (4) Release the object 14: destroy the actual object to release the memory space.

[0029] In this embodiment, the information stored in the access proxy object is the address of the actual object in the memory, and the user accesses the access proxy object through a pointer, allowing multiple users to point to the access proxy object at the same time, and the access pr...

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 preventing memory leak, which belongs to the technical field of memory management software. The method accesses an actual object by creating an access proxy object which corresponds to the actual object, thereby being capable of releasing the actual object by releasing a pointer which points to the actual object of the access proxy object after the end of calling, leading the access proxy object to only occupy a small amount of memory, and further avoiding great impacts on the performances of a computer even without releasing the access proxy object. The method can release the memory in a timely and accurate manner, thereby effectively reducing the memory leak of the computer.

Description

technical field [0001] The invention belongs to software technology, and in particular relates to a method for preventing memory leakage. Background technique [0002] In modern computer software technology, pointers are often used to refer to memory objects. Only when the pointer count of the object being referenced is zero, the memory object is allowed to be destroyed, thereby releasing the memory space it occupies. The above method uses counting to mark whether a memory object is referenced by other parties. In the conventional method, if it is referenced once, the counter will increase by 1, and if it is no longer referenced, it will be decremented by 1. When the reference count is zero, the memory object is allowed to be used. destroy. The key to the above method is that the references to the object must be registered in pairs. If the number of references is more than the number of releases, the reference technology of the object will always be greater than 1, that is,...

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/36G06F9/50
Inventor 李平立王会波梁长庆龙武
Owner PEKING UNIV