Memory leak analysis method and related device

A memory leak and analysis device technology, applied in the computer field, can solve problems such as memory leaks and occupancy

Active Publication Date: 2019-04-16
TENCENT TECH (SHENZHEN) CO LTD
View PDF4 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In this way, object b and object c will always occupy, causing a memory leak

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 leak analysis method and related device
  • Memory leak analysis method and related device
  • Memory leak analysis method and related device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0029] Generally, apps on mobile terminals may have memory leaks. Most memory leaks are caused by memory circular references. The memory leak analysis method and related devices (eg, memory leak analysis device, mobile terminal) provided by the present invention can perform memory leak analysis and locate objects with memory circular references.

[0030] The memory leak analysis device can be applied in the mobile terminal in the form of software. When it exists in the form of software, the above-mentioned memory leak analysis device can be an independent APP, or can be used as a component of an APP or an operating system.

[0031] Alternatively, the above-mentioned memory leak analysis apparatus may be in the form of hardware as a component of the mobile terminal (for example, it may specifically be a controller / processor of the mobile terminal).

[0032] The above memory leak analysis method and related devices are applicable to the development and testing environment of mo...

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 memory leak analysis method and a related device, which are used for analyzing memory leak and positioning an object with memory cyclic reference. The method comprises: obtaining strong reference objects of a target object, the strong reference objects being objects strongly referenced by the target object, the number of the target objects is at least i, the first target object being a monitored object with memory leakage, and the i target object being i -i target object; wherein the strong reference object is a target object; constructing a directed graph representing a strong reference relationship between the objects, the directed graph comprising nodes and directed edges, and different nodes representing different objects; wherein any two nodes associated with the directed edge comprise a starting point and a terminal point, and the object represented by the terminal point is a strong reference object of the object represented by the starting point; traversing nodes in the directed graph to determine whether the nodes in the directed graph form a loop or not; and if a loop is formed, positioning the object represented by the node onthe loop as an object causing memory leakage.

Description

technical field [0001] The present invention relates to the field of computer technology, and more specifically relates to a memory leak analysis method and a related device. Background technique [0002] Memory leaks, also known as storage leaks, refer to the phenomenon that the memory space dynamically requested by the program during the running process is not released after use, causing objects to occupy the memory all the time. [0003] Most memory leaks are caused by memory circular references. Although there is an ARC (Automatic Reference Counting) memory management mechanism, mutual references between two or more objects will still cause memory circular references, which in turn lead to memory leaks. For example, object a creates and strongly references object b, object b creates and strongly references object c, and object c creates and strongly references object b. Also, the reference counts of objects b and c are 2 and 1, respectively. When object a no longer use...

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
CPCG06F11/3636G06F11/3644
Inventor 丁海盛
Owner TENCENT TECH (SHENZHEN) 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