Java 程序资源泄露缺陷检测: 传统模型和语言模型的有效性分析

Translated title of the contribution: Detection of Resource Leaks in Java Programs: Effectiveness Analysis of Traditional Models and Language Models

Tian Yang Liu, Jia Wei Ye, Wei Xing Ji*, Hui Liu

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

Abstract

Resource leaks, which are defects caused by the failure to timely and properly close the limited system resources, are widely present in programs of various languages and possess a certain degree of concealment. The traditional defect detection methods usually predict the resource leaks in software based on rules and heuristic search. In recent years, defect detection methods based on deep learning have captured the semantic information in the code through different code representation forms and by using techniques such as recurrent neural networks and graph neural networks. Recent studies show that language models have performed outstandingly in tasks such as code understanding and generation. However, the advantages and limitations of large language models (LLMs) in the specific task of resource leak detection have not been fully evaluated. The effectiveness of the detection methods based on traditional models, small models, and LLMs in the task of resource leak detection is studied, and various improvement methods such as few-shot learning, fine-tuning and the combination of static analysis and LLMs are explored. Specifically, taking the JLeaks and DroidLeaks datasets as the experimental objects, the performance of different models is analyzed from multiple dimensions such as the root causes of resource leaks, resource types and code complexity. The experimental results show that the fine-tuning technique can significantly improve the detection effect of LLMs in the field of resource leak detection. However, most models still need to be improved in identifying the resource leaks caused by third-party libraries. In addition, the code complexity has a greater influence on the detection methods based on traditional models for resource leak detection.

Translated title of the contributionDetection of Resource Leaks in Java Programs: Effectiveness Analysis of Traditional Models and Language Models
Original languageChinese (Traditional)
Pages (from-to)2432-2452
Number of pages21
JournalRuan Jian Xue Bao/Journal of Software
Volume36
Issue number6
DOIs
Publication statusPublished - 2025
Externally publishedYes

Fingerprint

Dive into the research topics of 'Detection of Resource Leaks in Java Programs: Effectiveness Analysis of Traditional Models and Language Models'. Together they form a unique fingerprint.

Cite this