B
B
boov2013-10-23 13:22:32
Windows
boov, 2013-10-23 13:22:32

Comment on WinDbg output?

Please explain the purpose of some fields of the WinDdb debugger output in the following case:
0:023> !heap -s 0x0B780000
Walking the heap 0b780000 .......Virtual block: 0c620000 - 0c620000 (size 00000000)
Virtual block: 0cfa0000 - 0cfa0000 (size 00000000)
Virtual block: 0dc30000 - 0dc30000 (size 00000000)
...
0: Heap 0b780000
Flags 00001002 - HEAP_GROWABLE
Reserved memory in segments 64768 (k)
Commited memory in segments 34640 (k)
Virtual bytes (correction for large UCR) (k) 3464 large UCR )
Free space 1680 (k) (42 blocks)
External fragmentation 4% (42 free blocks)
Virtual address fragmentation 0% (1 uncommited ranges)
Virtual blocks 25 — total 0 KBytes
Lock contention 14
Segments 7
0 hash table for the free list
Commits 0
Decommitts 0
Lookaside heap 0b780688

Fragmentation fields are of interest - External fragmentation and Virtual address fragmentation, what is it and what is the difference.
And the Virtual bytes (correction for large UCR) field - what kind of memory is it, how is it related to committed and reserved memory.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mark_ablov, 2013-10-23
@mark_ablov

UCR - Un Committed Ranges, almost the same as Reserved / Committed for virtual memory.
When a heap segment is allocated, the heap manager requests a conditionally large amount of virtual memory (1M by default, EMNIP). Of course, the program does not use the entire heap at once, so there are commited segments in the heap, and there are those that have not yet been allocated from the original block given by the VM manager.
In this case (output of !heap) reserved/commited refer to terms of heap manager, and have no direct relation to reserved/commited VM manager.
Virtual address fragmentation and External fragmentation demonstrate different scales of fragmentation - the first is segments and their fragmentation, the second is blocks within segments.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question