如何调试Memory Leak 和 Handle Leak
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
如何调试Memory Leak 和Handle Leak
1. Handle Leak: A handle leak is a type of software bug that occurs
when a computer program asks for a handle to a resource but does not the handle when it is no longer us. If this occurs
frequently or repeatedly over an tended period of , a large number of handles may be marked in-use and thus unavailable, causing perfoae problems or a crash. The leak of handle itself is not a big problem. The problem is that handle leak causes the leak of kernel paged pool. 2. Memory Leak: A memory leak is a particular type of unintentional memory conmption by a computer program where the program fai to release memory when no longer needed. This condition is normally the result of a bug in a program that prevents it from freeing up memory that it no longer needs.
Memory is ale to program logic flaws. //--------------------------------------------------------------------------------------------- Symptoms: A. Handle Leaks 1. System running out of non-paged pool. 2. Failing handle allocations. 3. Degradation in system performance. 4. Excessive paging. 5. Tools like Task Manager and PerfMon show increasing handle count. B. Memory Leaks 1. System running out of virtual memory. 2. Failing memory allocations. 3. Degradation in system performance. 4. Excessive paging. 5. Tools like Task Manager and PerfMon show increasing memory counters for Working Set Size, Commit Size and Virtual Memory Size.
//--------------------------------------------------------------------------------------------- Causes: A. Handle Leaks 1. The programmer mistakenly forget to close the handles. The OPEN and CLOSE operations are not in pairs. 2. Incorrect error
第1页共4页。