Method for intelligently detecting C program memory leakage based on machine learning

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: 2018-11-13
NANJING UNIV
View PDF1 Cites 4 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
  • Method for intelligently detecting C program memory leakage based on machine learning
  • Method for intelligently detecting C program memory leakage based on machine learning
  • Method for intelligently detecting C program memory leakage based on machine learning

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 a method for intelligently detecting C program memory leakage based on machine learning. The method has three stages; in a model construction stage, two data sets are constructed according to original memory leakage; memory leakage characteristics are extracted respectively from the two data sets; the memory leakage characteristics are input into a machine learning classifier, so that training and cross validation are carried out; the type and the parameter of the classifier are modified; the memory leakage is detected by taking the classifier having highest classification accuracy rate as the classifier model; in a program analysis and characteristic obtaining stage, a source program is pre-analyzed; all memory allocation points o are obtained; then, pointer analysis is carried out; a VFG (Value Flow Graph) at the beginning of o is constructed; the memory leakage characteristics corresponding to each path in the VFG are extracted; in a defect detection and report stage, the memory leakage characteristics in the program analysis and characteristic obtaining stage are input into the classifier model in the model construction stage and detected; whether memoryleakage exists in a path at the beginning of o or not is judged; and thus, a memory leakage 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 Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/366
Inventor 王林章朱亚伟李宣东
Owner NANJING 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