Python code memory leak detection method based on mode

A memory leak and detection method technology, applied in the field of pattern-based Python code memory leak detection, can solve the problems of high cost and achieve high accuracy and fast speed

Active Publication Date: 2021-09-17
HANGZHOU DIANZI UNIV
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, for Python, the code does not have explicit memory allocation and deallocation statem

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
  • Python code memory leak detection method based on mode
  • Python code memory leak detection method based on mode

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0102] The steps in this embodiment are the same as those in the specific implementation manner, and will not be repeated here. Part of the implementation process and results are shown below:

[0103] Data source acquisition: the code used in this embodiment is the source code of 4 real open source projects obtained from the GitHub open source community. Since the project does not save information about real memory leaks, it is necessary to run the test cases of each project to collect the memory leak information generated during the running process, and the relevant statistical information of each project is shown in Table 1. Then, the collected memory leaks are manually classified into 6 modes in accordance with the technical solution of the present invention.

[0104] Result verification: In this embodiment, the collection of circular references that cause memory leaks collected during the actual code running process is compared with the collection of circular refere...

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 Python code memory leak detection method based on a mode. According to the method, type information of Python codes is obtained by means of type inference, memory leak detection is carried out in combination with a self-defined mode, and circular reference causing memory leak is obtained. The detection method has the advantages of being high in precision, high in speed and the like, memory leakage existing in the code can be effectively detected before the code runs, and relevant developers are timely notified to adopt corresponding solutions. The Python code memory leak detection method based on the mode, provided by the invention, is different from the characteristic that a conventional detection method only analyzes the use condition of a memory during code operation, is suitable for detection of a coding stage in a software development process, and is beneficial to discovering defect codes as early as possible.

Description

technical field [0001] The invention relates to the technical field of software, in particular to a pattern-based Python code memory leak detection method. Background technique [0002] Memory leak is a common error in software engineering, that is, after the program dynamically applies for memory, it does not release the memory before it ends, resulting in long-term occupation of memory resources. Early in a project, memory leaks often don't have any noticeable symptoms. The occurrence of memory leaks is a continuous process. As they accumulate in the system, the number of leaked objects will continue to increase, resulting in a continuous decrease in memory resources in the system. When the memory resources in the system are exhausted, the application programs in the system will temporarily suspend, waiting for the reallocation of memory. If the memory reallocation process takes a long time, it will crash the system. [0003] In recent years, programming languages ​​hav...

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
CPCG06F11/366G06F11/3644
Inventor 陈洁姜涛俞东进胡海洋
Owner HANGZHOU DIANZI UNIV
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