Research on Automated Memory Leak Detection Method Based on Cross-Function Context Tracing
Memory leaks pose a serious threat to the stability of C/C++-based Linux server applications, particularly in long-running systems such as databases and network services. However, accurate detection is challenging due to pointer propagation across functions and threads. Traditional tools like Valgrind and AddressSanitizer often incur high overhead and suffer from false positives in complex multithreaded environments. To address these issues, this paper proposes a hybrid approach that combines static resource propagation graphs with dynamic context-aware tracking. By analyzing resource lifetimes at the LLVM IR level and applying lightweight runtime instrumentation, the method effectively captures cross-function and cross-thread reference relationships. Experiments demonstrate a 98% detection rate, with false positives under 2.5% and average performance overhead below 15%. Compared with existing tools, the proposed solution significantly improves both detection accuracy and runtime efficiency, making it well-suited for memory leak detection in complex real-world applications.
Authors
- Yan Zhuang (ORCID: https://orcid.org/0000-0002-7640-4330)
- Menglan Li (ORCID: https://orcid.org/0000-0001-9312-3111)
Institutions
- Zhengzhou University (CN)
Publication Details
- Published
- 2025-05-09
- DOI
- https://doi.org/10.1109/aemcse65292.2025.11042800
- Primary Topic
- Advanced Malware Detection Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00