Detection of Resource Leaks in Java Programs: Effectiveness Analysis of Traditional Models and Language Models
Author:
Affiliation:

Clc Number:

TP311

Fund Project:

  • Article
  • |
  • Figures
  • |
  • Metrics
  • |
  • Reference
  • |
  • Related
  • |
  • Cited by
  • |
  • Materials
  • |
  • Comments
    Abstract:

    Resource leaks are software defects caused by improper closing of limited system resources, and they are prevalent in program software written in various languages and somewhat concealed. Traditional defect detection approaches rely on rules and heuristics. In recent years, deep learning approaches have used various code representations and technologies, such as RNN and GNN, to understand code semantics. Language models (LMs) have demonstrated significant advancements in code understanding and generation in recent research, yet their effectiveness in resource leak detection remains underexplored. This study evaluates traditional model-based, small language model-based (SLM-based) and large language model-based (LLM-based) methods for resource leak detection and investigates enhancements through few-shot learning, fine-tuning, and integration of static analysis with LLMs. Using the JLeaks and DroidLeaks datasets, we evaluate model performance from multiple perspectives, including the root causes of leaks, resource types, and code complexity. Our findings indicate that fine-tuning can significantly improve LM’s performance. However, most models need further improvement in detecting resource leaks from third-party libraries. Furthermore, code complexity has a greater impact on traditional model-based detection methods for resource leak detection.

    Reference
    Related
    Cited by
Get Citation

刘天阳,叶嘉威,计卫星,刘辉. Java程序资源泄露缺陷检测:传统模型和语言模型的有效性分析.软件学报,2025,36(6):0

Copy
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:August 26,2024
  • Revised:October 14,2024
  • Adopted:
  • Online: December 10,2024
  • Published:
You are the firstVisitors
Copyright: Institute of Software, Chinese Academy of Sciences Beijing ICP No. 05046678-4
Address:4# South Fourth Street, Zhong Guan Cun, Beijing 100190,Postal Code:100190
Phone:010-62562563 Fax:010-62562533 Email:jos@iscas.ac.cn
Technical Support:Beijing Qinyun Technology Development Co., Ltd.

Beijing Public Network Security No. 11040202500063