output garbage from windbg heap summary
First, My English is not good. So sorry. I'm not living English area.
I have a question.
I'm working memory fragmentation of Windows server program. Because of out of memory cannot run more than a week. May be problem it is.
So, I used to heap memory analysis by windbg to '.heap -s address(heap handle) command. But I don't understand this report. Look at it.
0:023> !heap -s 0x01490000
Walking the heap 0000000001490000 ...........
0: Heap 0000000001490000
-- Omitted --
Flags 00001002 - HEAP_GROWABLE
Reserved memory in segments 1047616 (k)
Commited memory in segments 617812 (k)
Virtual bytes (correction for large UCR) 188152 (k)
Free space 549 (k) (25 blocks)
External fragmentation 0% (25 free blocks)
Virtual address fragmentation 1254577998% (3 uncommited ranges)
Virtual blocks 32 - total 0 KBytes
Lock contention 1
Segments 11
Virtual address fragmentation have garbage value. what's the problem?? Is it right value??
I have planned. Tried to verify performance improvement. Also, determine if there are probl开发者_如何学Goems. But cannot be, because this problem.
I tried search many kind of article. but I could not get useful information.
Please help me.
First, Why did it happen?
Second, Is way approach for more effective using memory?
May be, you read my post is difficult. I know. so really really sorry.
Thank you for reading my post.
If you suspect a memory leak, then a great tool to use would be UMDH. This is a free tool and there are good docs on MSDN. This will allow you to get callstacks on allocs/deallocs and see exactly what call stacks are leaking, provided you have full symbols.
Windbg heap command is sometimes buggy, especially when tracking huge leaks. To examine memory fragmentation you would better use Vmmap http://technet.microsoft.com/en-us/sysinternals/dd535533
You will figure out the suspected memory location from Vmmap report. Then use Windbg to view the content of those allocations.
To get an analysis on memory fragmentation problems, I normally use DebugDiag. The official version is 1.1 but if you use Windows 7 or Windows Server 2008, you will need version 1.2 beta, which is available at http://viisual.net/Tools/ (source).
Recently, I found out I can use Windbg's "!address" command to give me a complete dump of the process's address space. By putting this into an Excel spreadsheet, convert all the hex values to binary and do some max/sum functions, I can quickly find out how much is the biggest contiguous block available vs. how much space unallocated, which is a good indication of how much the fragmentation is. I haven't tried this but armed with that memory map, in theory, you can find out the bad fragments and inspect the memory content.
Either of these suggestions will not give you how the fragmentation happened. I would definitely try out the UMDH tool that nithins suggested next time.
精彩评论