I am using WinDbg to see number of heaps in the process by using, dt _PEB @$peb
. I get following info,
+0x088 NumberOfHeaps : 1
Now according to Advanced Windows Debugging book,
Most applications implicitly use components that create their own heaps. A great example is the C runtime, which creates its own heap during initialization.
I add breakpoint at main, still I can see there is only one heap in process.
Secondly, I ran following code, still number of heap is 1.
BYTE* pAlloc1 = NULL;
BYTE* pAlloc2 = NULL;
HANDLE hProcessHeap = GetProcessHeap();
pAlloc1 = (BYTE*)HeapAlloc(hProcessHeap, 0, 16);
pAlloc2 = (BYTE*)HeapAlloc(hProcessHeap, 0, 1500);
Why I am not getting number of heap incremented in process?