Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for detecting IOS memory leak and computer readable medium

A memory leak and computer technology, applied in the detection of faulty computer hardware, fault hardware testing methods, calculations, etc., can solve problems such as inability to detect leaks, memory leaks, poor performance, etc., to improve the detection hit rate, improve Repair rate, ensure the effect of high efficiency

Pending Publication Date: 2022-01-07
INSPUR SOFTWARE CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] On the iOS side, the memory leak detection tools provided by the existing IDE Xcode are relatively rough and cannot perform good leak detection; at the same time, due to static code detection, there are large bottlenecks, many problems, and poor performance
As a language that uses ARC technology as the GC algorithm, memory leaks are a common and serious problem.

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 and device for detecting IOS memory leak and computer readable medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0031] The method for detecting IOS memory leaks of the present invention uses Method Swizzing technology to hook the constructors and destructors of the parent class NSObject of all self-built classes, and recognizes the life cycle of the object held by the current class, and detects the current Classes do need to be freed to detect memory leaks.

[0032] At runtime, we use Method Swizzing technology to hook the constructors and destructors of all classes, so as to clearly know whether the hooked class is released at the right time. We need to HOOK the constructors and destructors of all classes. In the OC language, because the parent class of all classes is NSObject. Therefore, we can directly hook the constructor and destructor of the NSObject class.

[0033] After we HOOK the life cycle function of the self-built class, we also need to know the life cycle of the self-built class clearly. We can know who is currently holding the HOOKed object. When the life cycle of the he...

Embodiment 2

[0050] The device of the present invention includes: at least one memory and at least one processor; at least one memory for storing a machine-readable program; at least one processor for calling the machine-readable program to execute any embodiment of the present invention methods disclosed in .

Embodiment 3

[0052] A computer-readable medium of the present invention stores computer instructions on the computer-readable medium, and when the computer instructions are executed by a processor, the processor executes the method disclosed in Embodiment 1. Specifically, a system or device equipped with a storage medium may be provided, on which a software program code for realizing the functions of any of the above embodiments is stored, and the computer (or CPU or MPU of the system or device) ) to read and execute the program code stored in the storage medium.

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 a method and device for detecting IOS memory leak and a computer readable medium, belongs to the technical field of memory leak detection, and aims to solve the technical problem of how to accurately, comprehensively and efficiently perform memory leak detection. According to the method, HOOK is carried out on constructor functions and destructor functions of parent class NSObject of all self-built classes through the Method Swizzing technology, the life cycle of an object held by the current class is identified, it is detected that the current class really needs to be released, and therefore whether memory leakage is caused or not is detected. According to the method, comprehensiveness and high efficiency of detection can be guaranteed, due to the fact that detection is carried out during running, the code compiling duration cannot be increased, due to the fact that life cycle detection of the object instance is achieved, the object instance can be detected as long as the object instance is not released, and the detection hit rate is increased.

Description

technical field [0001] The invention relates to the technical field of memory leak detection, in particular to a method, a device and a computer-readable medium for detecting IOS memory leaks. Background technique [0002] On the iOS side, the memory leak detection tools provided by the existing IDE Xcode are relatively rough and cannot perform good leak detection; at the same time, due to static code detection, there are large bottlenecks, many problems, and poor performance. As a language that uses ARC technology as the GC algorithm, memory leaks are a common and serious problem. So we urgently need a more accurate, comprehensive and efficient memory leak detection tool. [0003] Based on the above, how to accurately, comprehensively and efficiently detect memory leaks is a technical problem that needs to be solved. Contents of the invention [0004] The technical task of the present invention is to provide a method, a device and a computer-readable medium for detectin...

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/22
CPCG06F11/2205G06F11/2273
Inventor 单文政
Owner INSPUR SOFTWARE CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products