3

I am trying to investiagte memory issues with my application. Here is .NET heap size.

0:000> !EEHeap -gc
Number of GC Heaps: 4
------------------------------
Heap 0 (000000000111f740)
generation 0 starts at 0x000000019eb31750
generation 1 starts at 0x000000019e41f328
generation 2 starts at 0x0000000180091000
ephemeral segment allocation context: (0x000000019eb31750, 0x000000019eb31768)
 segment     begin allocated  size
0000000180090000  0000000180091000  00000001a4591d38  0x24500d38(609226040)
Large object heap starts at 0x0000000580091000
 segment     begin allocated  size
0000000580090000  0000000580091000  0000000580e3e868  0xdad868(14342248)
Heap Size:               Size: 0x252ae5a0 (623568288) bytes.
------------------------------
Heap 1 (000000000112afd0)
generation 0 starts at 0x000000029df85cb8
generation 1 starts at 0x000000029d7e5d78
generation 2 starts at 0x0000000280091000
ephemeral segment allocation context: (0x000000029df85cb8, 0x000000029df85cd0)
 segment     begin allocated  size
0000000280090000  0000000280091000  00000002a54d7f40  0x25446f40(625241920)
Large object heap starts at 0x0000000590091000
 segment     begin allocated  size
0000000590090000  0000000590091000  00000005927a0a90  0x270fa90(40958608)
Heap Size:               Size: 0x27b569d0 (666200528) bytes.
------------------------------
Heap 2 (0000000001137180)
generation 0 starts at 0x000000039d8552c0
generation 1 starts at 0x000000039d006788
generation 2 starts at 0x0000000380091000
ephemeral segment allocation context: (0x000000039d8552c0, 0x000000039d8552d8)
 segment     begin allocated  size
0000000380090000  0000000380091000  00000003a483c878  0x247ab878(612022392)
Large object heap starts at 0x00000005a0091000
 segment     begin allocated  size
00000005a0090000  00000005a0091000  00000005a12444f8  0x11b34f8(18560248)
Heap Size:               Size: 0x2595ed70 (630582640) bytes.
------------------------------
Heap 3 (0000000001144530)
generation 0 starts at 0x000000049ea19638
generation 1 starts at 0x000000049e1cfbb0
generation 2 starts at 0x0000000480091000
ephemeral segment allocation context: (0x000000049ea19638, 0x000000049ea19650)
 segment     begin allocated  size
0000000480090000  0000000480091000  00000004a4969bb8  0x248d8bb8(613256120)
Large object heap starts at 0x00000005b0091000
 segment     begin allocated  size
00000005b0090000  00000005b0091000  00000005b08a0e90  0x80fe90(8453776)
Heap Size:               Size: 0x250e8a48 (621709896) bytes.
------------------------------
GC Heap Size:            Size: 0x9784c728 (2542061352) bytes.

When I run the perfView, its showing AsyncPinned handles as taking most of memory as shown below.

enter image description here enter image description here

This is what !Gchandles is showing.

Handles:
    Strong Handles:       7653
    Pinned Handles:       16
    Async Pinned Handles: 1183
    Weak Long Handles:    2412
    Weak Short Handles:   918
    Dependent Handles:    2

I don't know much about AsyncPinned handles but how can I know which objects are creating these handles, who is holding off to these and why are these not getting cleaned up?

EDIT I have read the link that is makred duplicate for this, but I am trying to find out how can I know where these AsyncPinned handles are created which is not explained in that link

Community
  • 1
  • 1
crazy novice
  • 1,757
  • 3
  • 14
  • 36
  • Information about Async Pinned Handles http://stackoverflow.com/questions/7554927/what-is-an-async-pinned-handle – Steve Mitcham Mar 11 '15 at 13:21
  • Thanks for the link. I can google information about AsyncPinned object also. The real question is who is creating these, why are these holding off and how to get rid of these – crazy novice Mar 11 '15 at 13:22
  • Sorry, I thought the link contained enough information, looks like you have some type of I/O that isn't getting closed out properly. Are you disposing all file handles that your application is opening? – Steve Mitcham Mar 11 '15 at 13:25
  • No worries, Hopefully I am disposing but this application is huge and does Files and other type of I/O so many places. Can I get something out of dumpf ile to know who is creating these handles that are not cleaned up? – crazy novice Mar 11 '15 at 13:28
  • Getting something like ANTS, or dotMemory might help you track down the GC handles that you have open. – Steve Mitcham Mar 11 '15 at 13:29
  • So its not possible to find this info using dump file (windbg/sos) or perfView? – crazy novice Mar 11 '15 at 13:30
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/72759/discussion-between-steve-mitcham-and-paul-snow). – Steve Mitcham Mar 11 '15 at 13:33
  • Have you found any solution? I'm seeing a similar picture - an ASP.NET app suddenly eats 2GB of memory and PerfView shows AsyncPinned handles taking up all the space. – Alex from Jitbit Feb 06 '21 at 12:11

0 Answers0