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

A machine learning-based intelligent detection method for c program memory leaks

A technology of memory leaks and machine learning, which is applied in error detection/correction, instrumentation, software testing/debugging, etc. It can solve the problems of many static analysis false positives, high dynamic detection overhead, unable to solve memory leaks, etc., and achieve classifier results Accurate, short time consumption, fast detection effect

Active Publication Date: 2021-12-17
NANJING UNIV
View PDF1 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The current memory leak detection methods usually use static analysis and dynamic detection. Static analysis has too many false positives, and cannot solve memory leaks caused by some complex structures in C language, and the overhead of dynamic detection is high.

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
  • A machine learning-based intelligent detection method for c program memory leaks
  • A machine learning-based intelligent detection method for c program memory leaks
  • A machine learning-based intelligent detection method for c program memory leaks

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0033] The following is a more detailed description of the present invention using the machine learning-based intelligent detection method of C program memory leaks and specific implementation methods.

[0034] According to attached figure 1 The flow chart of the shown machine learning-based C program memory leak intelligent detection method, the specific embodiment of the present invention is:

[0035] 1) Construct two data sets based on existing memory leaks, one is a data set containing real memory leaks, and the other is a data set containing false memory leaks.

[0036] 2) Extract memory leak features. Memory leak features include two types: type information and pointer information. Such as figure 2 Shown are examples of memory leak features extracted during model training (each row represents a memory leak feature. The first column represents a label: 1 represents a memory leak, 0 represents no memory leak. The last 15 columns are memory leak features, and each colum...

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 intelligent detection method for C program memory leaks based on machine learning, which is divided into three stages: the model construction stage, constructing two data sets according to existing memory leaks, and extracting memory leak features from the two data respectively , input the memory leak features into the machine learning classifier for training, cross-validate, modify the classifier type and parameters, and select the classifier model with the highest classification accuracy as the classifier model to detect memory leaks. In the program analysis and feature acquisition stage, the source program is pre-analyzed to obtain all memory allocation points o, and then pointer analysis is performed to construct a VFG (ValueFlowGraph) starting from o, and the memory leak characteristics corresponding to each path in the VFG are extracted. In the defect detection and reporting stage, the memory leak features in the program analysis and feature acquisition stages are input into the classifier model in the model construction stage for detection, and it is judged whether there is a memory leak in the path starting from o, and a memory leak report is obtained.

Description

technical field [0001] The invention relates to a memory leak detection method, which uses a program static analysis method and a machine learning algorithm to realize memory leak detection, and belongs to the field of software engineering. Background technique [0002] In computer science, program static analysis refers to the analysis of computer software without actually executing the program. In most cases the analysis is performed on some version of the source code, in other cases it is some form of object code. Common machine learning algorithms include decision trees, random forests, logistic regression, SVM, naive Bayes, etc. The advantage of SVM is that it simplifies the usual classification and regression problems. The complexity of its calculation depends on the number of support vectors, not the dimension of the sample space. Therefore, SVM is not only simple in algorithm but also has good robustness. [0003] At present, the detection of memory leaks mainly ad...

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 Patents(China)
IPC IPC(8): G06F11/36
CPCG06F11/366
Inventor 王林章朱亚伟李宣东
Owner NANJING UNIV
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