• Uncategorized

About linux : What-does-the-Pinned-Handle-in-the-gcroot-result-mean-practically-in-the-context-of-debugging-high-memory-usage

Question Detail

I have the following gcroot output:

(lldb) gcroot 0x00007FC1EB641670
HandleTable:
    00007FC3900B1388 (pinned handle)
    -> 00007FC278027028 System.Object[]
    -> 00007FC1E82CF848 System.Collections.Concurrent.ConcurrentDictionary`2[[Dapper.SqlMapper+Identity, Dapper.StrongName],[Dapper.SqlMapper+CacheInfo, Dapper.StrongName]]
    -> 00007FBEEAA5E998 System.Collections.Concurrent.ConcurrentDictionary`2+Tables[[Dapper.SqlMapper+Identity, Dapper.StrongName],[Dapper.SqlMapper+CacheInfo, Dapper.StrongName]]
    -> 00007FBEEAA51000 System.Collections.Concurrent.ConcurrentDictionary`2+Node[[Dapper.SqlMapper+Identity, Dapper.StrongName],[Dapper.SqlMapper+CacheInfo, Dapper.StrongName]][]
    -> 00007FBE6BCB00C0 System.Collections.Concurrent.ConcurrentDictionary`2+Node[[Dapper.SqlMapper+Identity, Dapper.StrongName],[Dapper.SqlMapper+CacheInfo, Dapper.StrongName]]
    -> 00007FBE6BCAFFA0 Dapper.SqlMapper+Identity
    -> 00007FC1EB641670 System.String

Found 1 unique roots (run 'gcroot -all' to see all roots).

What is the meaning of the address 00007FC3900B1388? How can I locate the relevant logic in the code?

EDIT 1

The System.Object[] object at 00007FC278027028 takes 130584 bytes:

(lldb) dumpobj 00007FC278027028
Name:        System.Object[]
MethodTable: 00007fc315075510
EEClass:     00007fc315075488
Size:        130584(0x1fe18) bytes
Array:       Rank 1, Number of elements 16320, Type CLASS

I.e. it must be on LOH.

Please, find below the output of eeheap -gc

Number of GC Heaps: 8
------------------------------
Heap 0 (000000000125D930)
generation 0 starts at 0x00007FBE89EA6AA0
generation 1 starts at 0x00007FBE8895C1B0
generation 2 starts at 0x00007FBE67FFF000
ephemeral segment allocation context: none
         segment             begin         allocated         committed    allocated size    committed size
00007FBE67FFE000  00007FBE67FFF000  00007FBE8A4DD0A8  00007FBE94E3F000  0x224de0a8(575529128)  0x2ce40000(753139712)
Large object heap starts at 0x00007FC267FFF000
         segment             begin         allocated         committed    allocated size    committed size
00007FC267FFE000  00007FC267FFF000  00007FC277C6C938  00007FC277C8D000  0xfc6d938(264689976)  0xfc8e000(264822784)
00007FBCB442A000  00007FBCB442B000  00007FBCB51FCA48  00007FBCB51FD000  0xdd1a48(14490184)  0xdd2000(14491648)
Allocated Heap Size:       Size: 0x32f1d428 (854709288) bytes.
Committed Heap Size:       Size: 0x3d8a0000 (1032454144) bytes.
------------------------------
Heap 1 (0000000001265A20)
generation 0 starts at 0x00007FBF06D4BB48
generation 1 starts at 0x00007FBF0594AB08
generation 2 starts at 0x00007FBEE7FFF000
ephemeral segment allocation context: none
         segment             begin         allocated         committed    allocated size    committed size
00007FBEE7FFE000  00007FBEE7FFF000  00007FBF0766C740  00007FBF11B4B000  0x1f66d740(526833472)  0x29b4c000(699711488)
Large object heap starts at 0x00007FC277FFF000
         segment             begin         allocated         committed    allocated size    committed size
00007FC277FFE000  00007FC277FFF000  00007FC287F9DFF0  00007FC287FF5000  0xff9eff0(268038128)  0xfff6000(268394496)
00007FBC84424000  00007FBC84425000  00007FBC84EA2150  00007FBC84EA3000  0xa7d150(10998096)  0xa7e000(11001856)
Allocated Heap Size:       Size: 0x30089880 (805869696) bytes.
Committed Heap Size:       Size: 0x3a5c0000 (979107840) bytes.
------------------------------
Heap 2 (000000000126D8A0)
generation 0 starts at 0x00007FBF89893538
generation 1 starts at 0x00007FBF88849088
generation 2 starts at 0x00007FBF67FFF000
ephemeral segment allocation context: none
         segment             begin         allocated         committed    allocated size    committed size
00007FBF67FFE000  00007FBF67FFF000  00007FBF89EC4EB8  00007FBF94ADD000  0x21ec5eb8(569138872)  0x2cade000(749592576)
Large object heap starts at 0x00007FC287FFF000
         segment             begin         allocated         committed    allocated size    committed size
00007FC287FFE000  00007FC287FFF000  00007FC297FF8718  00007FC297FF9000  0xfff9718(268408600)  0xfffa000(268410880)
00007FBCE4430000  00007FBCE4431000  00007FBCE53E9098  00007FBCE53EA000  0xfb8098(16482456)  0xfb9000(16486400)
Allocated Heap Size:       Size: 0x32e77668 (854029928) bytes.
Committed Heap Size:       Size: 0x3da91000 (1034489856) bytes.
------------------------------
Heap 3 (0000000001275720)
generation 0 starts at 0x00007FC0079EF878
generation 1 starts at 0x00007FC006993E30
generation 2 starts at 0x00007FBFE7FFF000
ephemeral segment allocation context: none
         segment             begin         allocated         committed    allocated size    committed size
00007FBFE7FFE000  00007FBFE7FFF000  00007FC00C09B238  00007FC013259000  0x2409c238(604619320)  0x2b25a000(723886080)
Large object heap starts at 0x00007FC297FFF000
         segment             begin         allocated         committed    allocated size    committed size
00007FC297FFE000  00007FC297FFF000  00007FC2A7E5CBC0  00007FC2A7E7D000  0xfe5dbc0(266722240)  0xfe7e000(266854400)
00007FBCF4432000  00007FBCF4433000  00007FBCF55AB6D8  00007FBCF55CC000  0x11786d8(18319064)  0x1199000(18452480)
Allocated Heap Size:       Size: 0x350724d0 (889660624) bytes.
Committed Heap Size:       Size: 0x3c271000 (1009192960) bytes.
------------------------------
Heap 4 (000000000127D5A0)
generation 0 starts at 0x00007FC088CAE0B0
generation 1 starts at 0x00007FC087A4C4E8
generation 2 starts at 0x00007FC067FFF000
ephemeral segment allocation context: none
         segment             begin         allocated         committed    allocated size    committed size
00007FC067FFE000  00007FC067FFF000  00007FC08AC581F0  00007FC093EA6000  0x22c591f0(583373296)  0x2bea7000(736784384)
Large object heap starts at 0x00007FC2A7FFF000
         segment             begin         allocated         committed    allocated size    committed size
00007FC2A7FFE000  00007FC2A7FFF000  00007FC2B7F24C40  00007FC2B7F45000  0xff25c40(267541568)  0xff46000(267673600)
00007FBD237BE000  00007FBD237BF000  00007FBD24FBC270  00007FBD24FBD000  0x17fd270(25154160)  0x17fe000(25157632)
Allocated Heap Size:       Size: 0x3437c0a0 (876069024) bytes.
Committed Heap Size:       Size: 0x3d5eb000 (1029615616) bytes.
------------------------------
Heap 5 (0000000001285420)
generation 0 starts at 0x00007FC1097B5D90
generation 1 starts at 0x00007FC10872DB10
generation 2 starts at 0x00007FC0E7FFF000
ephemeral segment allocation context: none
         segment             begin         allocated         committed    allocated size    committed size
00007FC0E7FFE000  00007FC0E7FFF000  00007FC10DAD4388  00007FC114D2C000  0x25ad5388(632116104)  0x2cd2d000(752013312)
Large object heap starts at 0x00007FC2B7FFF000
         segment             begin         allocated         committed    allocated size    committed size
00007FC2B7FFE000  00007FC2B7FFF000  00007FC2C7DD3C68  00007FC2C7DF4000  0xfdd4c68(266161256)  0xfdf5000(266293248)
00007FBC74422000  00007FBC74423000  00007FBC74AD9BA0  00007FBC74ADA000  0x6b6ba0(7039904)  0x6b7000(7041024)
Allocated Heap Size:       Size: 0x35f60b90 (905317264) bytes.
Committed Heap Size:       Size: 0x3d1d9000 (1025347584) bytes.
------------------------------
Heap 6 (000000000128D2A0)
generation 0 starts at 0x00007FC1887CB3E0
generation 1 starts at 0x00007FC1877EFF98
generation 2 starts at 0x00007FC167FFF000
ephemeral segment allocation context: none
         segment             begin         allocated         committed    allocated size    committed size
00007FC167FFE000  00007FC167FFF000  00007FC18A95FE60  00007FC193A66000  0x22960e60(580259424)  0x2ba67000(732327936)
Large object heap starts at 0x00007FC2C7FFF000
         segment             begin         allocated         committed    allocated size    committed size
00007FC2C7FFE000  00007FC2C7FFF000  00007FC2D7F7E3F8  00007FC2D7FD5000  0xff7f3f8(267908088)  0xffd6000(268263424)
00007FBCD442E000  00007FBCD442F000  00007FBCD52B9180  00007FBCD52BA000  0xe8a180(15245696)  0xe8b000(15249408)
Allocated Heap Size:       Size: 0x3376a3d8 (863413208) bytes.
Committed Heap Size:       Size: 0x3c8c8000 (1015840768) bytes.
------------------------------
Heap 7 (0000000001295120)
generation 0 starts at 0x00007FC2086004E0
generation 1 starts at 0x00007FC2075711A8
generation 2 starts at 0x00007FC1E7FFF000
ephemeral segment allocation context: none
         segment             begin         allocated         committed    allocated size    committed size
00007FC1E7FFE000  00007FC1E7FFF000  00007FC20879C120  00007FC213FA3000  0x2079d120(544854304)  0x2bfa4000(737820672)
Large object heap starts at 0x00007FC2D7FFF000
         segment             begin         allocated         committed    allocated size    committed size
00007FC2D7FFE000  00007FC2D7FFF000  00007FC2E7F465B8  00007FC2E7F67000  0xff475b8(267679160)  0xff68000(267812864)
00007FBCC442C000  00007FBCC442D000  00007FBCC514E798  00007FBCC51A5000  0xd21798(13768600)  0xd78000(14123008)
Allocated Heap Size:       Size: 0x31405e70 (826302064) bytes.
Committed Heap Size:       Size: 0x3cc84000 (1019756544) bytes.
------------------------------
GC Allocated Heap Size:    Size: 0x199cdd658 (6875371096) bytes.
GC Committed Heap Size:    Size: 0x1e5872000 (8145805312) bytes.

The pinned handle value is 0x00007FC3900B1388. I am not sure how to compute the range that owns it. I do not see any numbers that produce a range that covers 0x00007FC3900B1388.

BTW, I have found the relevant static inside the Dapper.SqlMapper class:

public static class SqlMapper
{
    ...
    private static readonly ConcurrentDictionary<Identity, CacheInfo> _queryCache;
}

https://github.com/DapperLib/Dapper/blob/ca00feeb5fafe5262166689c0bec2b80b53add4e/Dapper/SqlMapper.cs#L59

Question Answer

No answer for now.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.