我们有一个已运行超过5个月的应用程序,它现在使用3.5GB内存。我们还注意到内存使用量正在逐渐增加。所以我们怀疑某处可能存在内存泄漏,我们使用DebugDiag工具来分析我们生成的转储文件。但是,我们很难理解分析结果。
以下是堆分析的摘要:
cy.get('[title|="Street Address 1"]').type('1322 the gulag archipelago')
第一个堆是默认进程堆,其大小与我们对应用程序的内存使用情况的观察一致。以下是第一堆的详细信息:
Heap Summary
Number of heaps 14 Heaps
Total reserved memory 3.36 GBytes
Total committed memory 3.33 GBytes
------------------------------------
Top 10 heaps by reserved memory
0x00240000 3.35GBytes
0x00600000 2.4MBytes
0x01fe0000 2.4MBytes
......
------------------------------------
Top 10 heaps by committed memory
0x00240000 3.35GBytes
0x00740000 1.45MBytes
0x00600000 1.44MBytes
......
很明显,这个堆分配了217个段,总计达3.35GB。然而,令我困惑的是下面显示的堆分配:
Heap Details
Heap 1 - 0x00240000
Heap Name Default process heap
Heap Description This heap is created by default and shared by all modules
in the process
Reserved memory 3.35 GBytes
Committed memory 3.32 GBytes(99.13% of reserved)
Uncommitted memory 29.89 MBytes(0.87% of reserved)
Number of heap segments 217 segments
Number of uncommitted ranges 227 range(s)
Size of largest uncommitted range 11.19 MBytes
Calculated heap fragmentation Unavailable
因此,前10个分配总计小于20 MB的内存,但总堆大小为3.3 GB。我希望其余的记忆可能去哪里?