I'm running a 32bit application and it fails on shortage of memory (bad_alloc is thrown). However, when I'm looking in the dump file I can see that most of the memory is in "busy internal". Moreover, it has 3GB of committed memory. To put it as questions
- Does it make sense that an app has so much "busy internal" memory?
- Is it something I can control and/or configure?
- Can I trigger some sort of memory consolidation of defragmentation?
DebugDiag:
Virtual Memory Analysis
Virtual Memory Summary
Size of largest free VM block 6.91 MBytes
Free memory fragmentation 92.S6%
Free Memory 96.78 MBytes (2.36% ofT0ta1 Memory)
Reserved Memory 856.05 MBytes (20.9% ofT0ta1 Memory)
Committed Memory 3.07 GBytes (76.7400 ofT0ta1 Memory)
Total Memory 4 GBytes
Largest free block at 0x00000000'ff1f6000
Partial output of WinDBG (!heap -a <heap>
)
e3268eee: 21ff8 . 42008 [101] - busy (41ff8) Internal
e32aaee8: 42008 . 21ff8 [101] - busy (21ff0) Internal
e32cceee: 21ff8 . 22008 [101] - busy (21ff8) Internal
e32eeee8: 22008 . 21ff8 [101] - busy (21ff0) Internal
e331eeee: 21ff8 . 42008 [101] - busy (41ff8) Internal
e3352008: 42008 . 41ff8 [101] - busy (41ff0) Internal
e3394eee: 41ff8 . 22008 [101] - busy (21ff8) Internal
e33b6008: 22008 . 21ff8 [101] - busy (21ff0) Internal
e33d8eee: 21ff8 . 22008 [101] - busy (21ff8) Internal
e33faee8: 22008 . 21ff8 [101] - busy (21ff0) Internal
e341ceee: 21ff8 . 42008 [101] - busy (41ff8) Internal
e345eee8: 42008 . 21ff8 [101] - busy (21ff0) Internal
e348eeee: 21ff8 . 42008 [101] - busy (41ff8) Internal
e34c2008: 42008 . 41ff8 [101] - busy (41ff0) Internal
e3504eee: 41ff8 . 42008 [101] - busy (41ff8) Internal
e3546008: 42008 . 41ff8 [101] - busy (41ff0) Internal
e3588eee: 41ff8 . 22008 [101] - busy (21ff8) Internal
e35aaee8: 22008 . 21ff8 [101] - busy (21ff0) Internal
e35cceee: 21ff8 . 42008 [101] - busy (41ff8) Internal
e36eeee8: 42008 . 41ff8 [101] - busy (41ff0) Internal
e365eeee: 41ff8 . 42008 [101] - busy (41ff8) Internal
e3692008: 42008 . 41ff8 [101] - busy (41ff0) Internal
e36d4eee: 41ff8 . 22008 [101] - busy (21ff8) Internal
UPDATE
Adding some more info in this - finding the total size of busy-internal
************************************************************************************************************************
NT HEAP STATS BELOW
************************************************************************************************************************
LFH Key : 0xc6ab7f8e
Termination on corruption : ENABLED
Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast
(k) (k) (k) (k) length blocks cont. heap
-----------------------------------------------------------------------------
01590000 00000002 2995168 2981356 2994956 27250 2871 211 4 1db2 LFH
01bb0000 00001002 1292 536 1080 46 5 2 0 0 LFH
-----------------------------------------------------------------------------
I ran !heap -a 01590000
and saved the output to a log. Then I summed up the results, categorized by 'free', 'busy', 'busy-internal' and these were my results
busy 1.106 MB
busy-internal 2883.606 MB
free 26.612 MB
uncategorized 26.612 MB
total bytes 3080648904
This result agrees with the size of the memory shows, for both the total and free memory. It is clear that most of the memory is marked as "internal" for some vague reason.