Automatic management method of object cached in memory

A memory caching and automatic management technology, applied in memory address/allocation/relocation, memory system, electrical digital data processing, etc., can solve problems such as application experience impact, memory consumption, memory leakage, etc., to avoid repeated creation.

Inactive Publication Date: 2017-03-22
BEIJING JINHER SOFTWARE
View PDF7 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Memory leak is a relatively common problem in the application development process. A serious leak will consume a large amount of memory, which will greatly affect the experience of the application itself, and even trigger OOM (mem

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
  • Automatic management method of object cached in memory
  • Automatic management method of object cached in memory
  • Automatic management method of object cached in memory

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0029] The present invention will be further described in detail below in conjunction with the accompanying drawings, so that those skilled in the art can implement it with reference to the description.

[0030] It should be understood that terms such as "having", "comprising" and "including" as used herein do not entail the presence or addition of one or more other elements or combinations thereof.

[0031] Such as figure 1 As shown, the present invention provides a method for automatically managing memory cache objects, comprising the following steps:

[0032] For an object placed in the memory cache, the object is placed in the strong reference queue and the weak reference queue at the same time,

[0033] When accessing the object, first look for whether the object exists in the strong reference queue, if yes, return, if not, continue to search for the object in the weak reference queue,

[0034] If the object is found in the weak reference queue, add the object from the ...

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 an automatic management method of an object cached in a memory. The automatic management method comprises the following steps: simultaneously putting the object, which is put into a memory cache, into a strong reference queue and a weak reference queue; when accessing the object, searching whether the object exists in the strong reference queue first, and if the object exists in the strong reference queue, returning; if the object does not exist in the strong reference queue, continuously searching whether the object exists in the weak reference queue; if the object is searched in the weak reference queue, adding the object from the weak reference queue into the strong reference queue; and if the object is not searched in the weak reference queue, establishing the object, and caching the object into the strong reference queue. According to the method disclosed by the invention, only one object exists in the memory within the same time, so that re-establishment of the object is avoided. The invention provides an automatic recycling mechanism of the memory; and no object is actively released from outside. By means of monitoring the weak reference queue, the object with memory leak can be found.

Description

technical field [0001] The invention belongs to the technical field of automatic management and relates to a method for automatic management of memory cache objects. Background technique [0002] Memory leak (memory leak) means that some objects are not recycled at the end of their life cycle and still occupy memory. Memory leak is a relatively common problem in the application development process. A serious leak will consume a large amount of memory, which will greatly affect the experience of the application itself, and even trigger OOM (memory overflow, that is, the memory usage exceeds the maximum allocated value) and other abnormal behavior. For languages ​​based on object recycling, singleton objects generally reside in memory, which sometimes leads to memory leaks. Contents of the invention [0003] An object of the present invention is to solve at least the above problems and / or disadvantages and to provide at least the advantages as will be described hereinafter...

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): G06F12/02G06F12/0877G06F12/0893
CPCG06F12/0253G06F12/0877G06F12/0893
Inventor 张楠
Owner BEIJING JINHER SOFTWARE
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