Background
In .NET applications, the Garbage Collector (GC) typically moves objects around in memory to prevent fragmentation. However, objects can be "pinned" in place, preventing the GC from relocating them. Excessive pinning can lead to heap fragmentation and application performance degradation.
Question
How can one investigate pinned objects using dotMemory
Answer
Follow the steps below to inspect pinned objects in dotMemory:
-
Open a memory snapshot in dotMemory
- dotMemory will open an Inspections tab by default
-
Scroll down to the Heap fragmentation section
-
Click on the Pinned objects to open pinned object set
-
Switch to Instances tab
-
Double-click on an instance or use Open this instance context action to inspect specific pinned object instance
- To understand why an object is being pinned, one might need to inspect Key Retention Paths and/or Creation Stack Trace by switching to corresponding tabs in the instance view
Comments
0 comments
Please sign in to leave a comment.