0

I host a asp.net(v4.0.30319) App on IIS7, and using the following WinDBG command find so manay objects not be released by GC.

!dumpheap -type XXXX
000000....   671  246928 XXXX

XXXX is the objects type's name , the amount of the objects is increased by 10+/M. but can't find any increase when I use ANTS Memoery Prfiler 8. and can't find any memory leaks when I using windows performance monitor. So I'm very superised that it's WinDBG's problem or the .get latency GC mode is applied?

Any body who can give me advice?

Thanks a lot.

Gary

gary
  • 21
  • 3
  • The advice is that don't panic to see lots of objects. GC won't free them after creation until the time is right. So you still need to learn about GC before saying it is memory leak. @ThomasW. provides more insights below. – Lex Li Mar 10 '14 at 14:42

1 Answers1

1

Not exactly an answer, but too long for a comment

The ANTS memory profiler will for a garbage collection in order to avoid false positives. WinDbg just provides a view on the current situation on the .NET heap, so the garbage collector may not have run.

How many WinDbg snapshots did you compare? Does the number only increase or does it also decrease sometimes?

In which garbage collection generation are the objects? Find the start address using

!eeheap -gc

and then

!dumpheap -stat -type XXXX <gc_generation_start_address>

for the different generations. If you have many objects in generation 2, they will not be collected so often any more.

Are the objects rooted or are they candidates for garbage collection? Try

!gcroot <object address>
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • Thanks a lot for Thomas's reply. – gary Mar 12 '14 at 00:45
  • Thanks a lot for Thomas's reply. I have compared many WinDBG snapshot, and find the amount is increased bug increase speed is slowly than before. but the increased objects is host on GC 0 always and without GC root. – gary Mar 12 '14 at 01:05