首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 593 毫秒
1.
Platforms with automatic memory management, such as the JVM, are usually considered free of memory leaks. However, memory leaks can happen in such environments, as the garbage collector cannot free objects, which are not used by the application anymore, but are still referenced. Such unused objects can eventually fill up the heap and crash the application. Although this problem has been studied extensively, nevertheless, there are still many rooms for improvement in this area. This paper describes the statistical approach for memory leak detection, as an alternative, along with a commercial tool, Plumbr, which is based on the method. The tool is later analyzed with three case studies of real applications and in the process also analyzes strengths and weaknesses of the statistical approach for memory leak detection. Copyright © 2014 John Wiley & Sons, Ltd.  相似文献   

2.
程序运行过程中一些不再被使用的对象未及时释放会引发内存泄漏问题,泄漏对象经过长期累积会降低系统性能,甚至导致系统崩溃。针对Java程序中的内存泄漏问题,提出了一种内存泄漏对象检测与度量方法。通过动态跟踪源程序的执行过程,周期性记录堆栈信息,并分析堆中可疑的泄漏对象。定义内存泄漏度计算方法,度量不同对象对程序泄漏的影响程度,从而确定产生泄漏的对象。最后选取两个开源程序进行验证,并与两种现有方法进行对比,结果表明该方法的泄漏检测率较高。  相似文献   

3.
雷达  曾庆凯 《计算机应用研究》2011,28(11):4315-4319
为了更加精确高效地分析源代码中的内存泄露,针对内存泄露属性分析建模,通过多种途径对现有的方法进行改进。使用函数摘要的方法提高分析效率,并使用对库函数建模、检测虚假路径的方法降低误报,同时尝试检测动态内存通过参数逃逸的情况。在crystal基础上实现了静态分析内存泄露的工具SMD,取得了良好的实验结果。  相似文献   

4.
C程序内存泄漏智能化检测方法   总被引:1,自引:1,他引:0  
内存泄漏在采用显式内存管理机制的C语言中是一种常见的代码缺陷,内存泄漏的检测方法目前主要是静态分析与动态检测.动态检测开销大,且高度依赖测试用例;静态分析目前被学术界和工业界广泛应用,但是存在大量误报,需要人工对检测结果进行确认.内存泄漏静态分析的误报通常是由于对指针、分支语句和全局变量分析的不准确性导致的.提出了一种内存泄漏的智能化检测方法,通过使用机器学习算法学习程序特征与内存泄漏之间的相关性,构建机器学习分类器,并应用机器学习分类器进一步提高内存泄漏静态分析的准确性.首先构建机器学习分类器,然后通过静态分析方法构建从内存分配点开始的Sparse Value Flow Graph(SVFG),并从中提取内存泄漏相关特征,再使用规则和机器学习分类器进行内存泄漏的检测.实验结果显示,该方法在分析指针、分支语句和全局变量时是有效的,能够提高内存泄漏检测的准确性,降低内存泄漏检测结果的误报.最后,对未来研究的可行性以及面临的挑战进行了展望.  相似文献   

5.
葛瑶  李晓风  孔德光 《计算机工程》2008,34(16):159-161
设计与实现一个轻量级的堆内存泄漏检测工具,针对使用C++编码的开源代码,通过重载new, delete运算符,动态跟踪程序在执行过程中堆内存块的分配释放情况,在程序运行结束时给出内存泄露的检测结果。实现时采用红黑树管理所分配的堆内存,理论推导和实验表明其具有较高的效率。  相似文献   

6.
Memory leaks are a common type of defect that is hard to detect manually. Existing memory leak detection tools suffer from lack of precise interprocedural analysis and path-sensitivity. To address this problem, we present a static interprocedural analysis algorithm, that performs fully pathsensitive analysis and captures precise function behaviors, to detect memory leak in C programs. The proposed algorithm uses path-sensitive symbolic execution to track memory actions in different program paths guarded by path conditions. A novel analysis model called memory state transition graph (MSTG) is proposed to describe the tracking process and its results. In order to do interprocedural analysis, the proposed algorithm generates a summary for each procedure from MSTG and applies the summary at the procedure’s call sites. A prototype tool called Melton is implemented for this procedure. Melton was applied to five open source C programs and 41 leaks were found. More than 90% of these leaks were subsequently confirmed and fixed by their maintainers. For comparison with other tools, Melton was also applied to some programs in standard performance evaluation corporation (SPEC) CPU 2000 benchmark suite and detected more leaks than the state of the art approaches.  相似文献   

7.
Linux下面向函数的动态内存泄漏监测   总被引:4,自引:1,他引:4  
动态内存泄漏是一个严重的编程错误,可以导致程序的错误行为。由于定位内存泄漏发生的位置是困难的,一些工具已被开发出来辅助程序员找出内存泄漏。论文提出了面向函数的动态内存泄漏监测的概念,阐述了它的必要性和有效性,并给出了在Linux下的实现。  相似文献   

8.
C/C 语言中的动态内存管理机制自由且灵活,但动态内存的使用容易引入内存泄漏,导致系统性能降低甚至系统崩溃。为了更加有效的检测内存泄漏,提出了一个基于有界模型检测技术的C/C 程序内存泄漏检测方案MLD-CBMC。该方案以C/C 程序文件为输入,利用有界模型检测技术,对程序进行展开处理,加入内存泄漏性质,并利用可满足性模理论(SMT)对程序约束和性质组成的验证条件编码,使用SMT求解器对验证条件求解,将检测内存泄漏问题转换为求解可满足性问题,实现C/C 程序内存泄漏的检测。通过实验验证了方案的有效性,并与其他有界模型检测工具进行对比实验,实验证明方案对内存泄漏的检测能力更强。  相似文献   

9.
一种混合式内存泄漏静态检测方法   总被引:1,自引:0,他引:1  
内存泄漏是导致系统性能降低的重要问题.提出一种基于模型检测算法的内存泄漏静态检查方法TMC.该方法依据程序的控制流图构建对应于程序执行的有限状态自动机,进而在此基础上应用模型检测算法分析程序中可能存在的内存泄漏.论文利用几个典型的程序实例详细说明了TMC的工作原理,并通过基于内存操作密集的测试程序集PtrDist的实验对TMC进行了验证.实验结果表明,TMC能够显著提升内存泄漏分析的精度.  相似文献   

10.
A memory leak in a managed language occurs when the program inadvertently maintains references to objects that it no longer needs. Memory leaks cause systematic heap growth that degrade performance and can result in program crashes after perhaps days or weeks of execution. Prior approaches for detecting memory leaks rely on heap differencing or detailed object statistics which store state proportional to the number of objects in the heap. These overheads preclude their use on the same processor for deployed long‐running applications. This paper introduces Cork as a tool that accurately identifies heap growth caused by leaks. It is space efficient (adding less than 1% to the heap) and time efficient (adding 2.3% on average to total execution time). We implement this approach of examining and summarizing the class of live objects during garbage collection in a class points‐from graph (CPFG). Each node in the CPFG represents a class and edges between nodes represent references between objects of the specific classes. Cork annotates nodes and edges with the corresponding volume of live objects. Cork identifies growing data structures across multiple collections and computes a class slice to identify leaks for the user. We experiment with two functions for identifying growth and show that Cork is accurate: it identifies systematic heap growth with no false positives in 4 of 15 benchmarks we tested. Cork's slice report enabled us to quickly identify and eliminate growing data structures in large and unfamiliar programs, something their developers had not previously done. Copyright © 2009 John Wiley & Sons, Ltd.  相似文献   

11.
WINCE系统内存配置较小,嵌入式软件如果出现内存泄露问题,将会导致系统的可用内存不足,甚至出现系统崩溃。为此针对WINCE操作系统内存的管理和应用,通过引入一个在实时更新动态图的过程中出现内存泄露的案例,阐述了关于内存管理和内存应用的重要知识点,包括内存模型和内存分配方式,分析了在该案例中出现内存泄露的原因,提出了与案例中出现的内存泄露相似问题的解决方法,并针对一般情况下如何防止内存泄露作了简单介绍,最后详细阐述了案例中为了优化内存所做的工作,对编程者有很好的指导作用。  相似文献   

12.
Mobile applications usually can only access limited amount of memory. Improper use of the memory can cause memory leaks, which may lead to performance slowdowns or even cause applications to be unexpectedly killed. Although a large body of research has been devoted into the memory leak diagnosing techniques after leaks have been discovered, it is still challenging to find out the memory leak phenomena at first. Testing is the most widely used technique for failure discovery. However, traditional testing techniques are not directed for the discovery of memory leaks. They may spend lots of time on testing unlikely leaking executions and therefore can be inefficient. To address the problem, we propose a novel approach to prioritize test cases according to their likelihood to cause memory leaks in a given test suite. It firstly builds a prediction model to determine whether each test can potentially lead to memory leaks based on machine learning on selected code features. Then, for each input test case, we partly run it to get its code features and predict its likelihood to cause leaks. The most suspicious test cases will be suggested to run at first in order to reveal memory leak faults as soon as possible. Experimental evaluation on several Android applications shows that our approach is effective.  相似文献   

13.
冯涛  宋成明 《微机发展》2006,16(7):123-125
Java语言的一个显著特点是它通过虚拟机和垃圾回收机制管理着大部分的内存事务,但是在Java程序中还是可能存在内存泄漏问题。文中首先对Java内存泄漏做一个简要的定义,接着围绕一个实例详细地介绍如何用工具检测Java内存泄漏,最后列举了一些典型的泄漏,以便读者在Java程序开发中尽量避免类似的内存泄漏。  相似文献   

14.
关于JAVA语言内存泄漏问题的探讨   总被引:1,自引:0,他引:1  
随着越来越多的服务器程序采用Java技术,例如电信网管系统,服务器程序往往长期运行,因此Java的内存泄漏问题不容忽视。否则即使有少量泄漏,长期运行之后,系统将会面临崩溃的危险。文章通过分析Java内存回收机制的原理和内存泄漏的原因,提出了预防和检测内存泄漏的办法。  相似文献   

15.
内存泄漏是软件系统中常见的一种错误,会持续消耗内存,致使系统运行效率下降,甚至导致系统崩溃。内存泄漏的检测工具主要可以分为两类:一类是使用基于程序扫描分析技术的静态工具;另一类则是监视实时内存分配状态进行判别的动态工具。如何评估工具检测内存泄漏的能力,相关的标准并不明确。通过对内存泄漏的认识与了解,对相关工具能力进行了调研与分析,提出了一个内存泄漏工具的评估标准。  相似文献   

16.
随着越来越多的服务器程序采用Java技术,例如电信网管系统,服务器程序往往长期运行,因此Iava的内存泄漏问题不客忽视。否则即使有少量泄漏,长期运行之后,系统将会面临崩溃的危险。文章通过分析Java内存回收机制的原理和内存泄漏的原因.提出了预防和检测内存泄漏的办法。  相似文献   

17.
We address the problem of applying resource-bounded functional programming languages in practice on object-oriented virtual machines which include calls to native methods coded in low-level languages without garbage collection support. We consider the application of a functional language with a high-level type system which incorporates measures of heap space consumption in types on such an execution platform. We supplement the syntactic type inference procedure of the functional language with a separate analysis which estimates the costs of memory leaks incurred by calls to garbage collection-ignorant functions.  相似文献   

18.
王淑栋  尹文静  董玉坤  张莉  刘浩 《软件学报》2020,31(5):1276-1293
C程序中数组、malloc动态分配后的连续内存等顺序存储结构被大量使用,但大多数传统的数据流分析方法未能充分描述其结构及其上的操作,特别是在利用指针访问顺序存储结构时,传统的分析方法只关注了指针的指向关系,而未讨论指针可能发生偏移的数值信息,且未考虑发生偏移时可能存在越界的不安全问题,导致了对顺序存储结构分析不精确.针对以上不足,首先对顺序存储结构进行抽象建模,并对顺序存储结构与指针结合使用时的指向关系与偏移量进行有效表示,建立了用于顺序存储结构的抽象内存模型SeqMM;其次,归纳总结C程序中顺序存储结构涉及的指针相关迁移操作、谓词操作及遍历顺序存储结构的循环操作,提出了安全范围判别保证操作安全性;之后,针对函数调用时形参指针引用顺序存储结构与实参的映射过程进行过程间推导规则设计;最后,基于上述分析,提出了一种内存泄漏缺陷检测算法对5个开源C工程的内存泄漏缺陷进行检测.实验结果表明:所提出的SeqMM能够有效地刻画C程序中的顺序存储结构及其涉及的各种操作,其数据流分析结果能够用于内存泄漏的检测工作,同时在效率和精度之间取得合理的权衡.  相似文献   

19.
孙青岩  陈平 《计算机工程》2004,30(20):42-44
内存泄漏是程序设计中经常出现的问题,会降低系统性能,甚至耗尽内存空间导致系统崩溃。文章采用反射和开放编译技术,对开放编译器OpenC 进行了扩展与改进,设计并实现了一个CC 动态内存泄漏检测工具,以帮助开发和测试人员查找内存泄漏。  相似文献   

20.
Android开发已经成为移动开发热门领域,Android应用程序中内存使用的问题却经常容易被忽视,部分开发者对Java垃圾回收机制认识模糊,使得内存泄漏成为Android应用开发中十分隐秘但又确实存在的应用安全问题,对内存泄漏的危害进行了阐述,并根据与Activity、Service、ContentProvider、Broadcast Receiver等Android组件的相关性归类介绍了一些常见的典型内存泄漏情景,最后分析总结内存泄漏代码特征,并设计一种基于符号执行的内存泄漏静态代码检测方案。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号