Repository navigation
Closed
Description
I'm working on a large set of Native and GC heap improvements throughout the dotnet runtime, SOS, ClrMD, PerfView, and ICorDebug (though ICorDebug is mostly bugfixing). I'm using this issue to track the work.
The through lines of this project are:
- Make managed and native heap analysis easier and more accurate.
- Consolidate a lot of complicated GC logic into ClrMD so that we do not have multiple copies.
- Instead of spot-fixing the complicated C++ SOS commands, rewrite them in C# where possible to make them easier to maintain.
ClrMD work:
- Change ClrHeap to understand multiple gc_heaps instead of hiding this detail
- Add heap verification code to ClrMD
- Add ThinLock support, then update !dumpheap
- Consider adding !analyzeoom related data to ClrMD
- Improve ObjectSet
- Improve GCRoot related code in ClrMD
- Investigate whether Finalizer Queue roots are being properly enumerated by the dac
Requests from the GC team:
- Add ways to dump specific heaps, segments, or ranges to various SOS commands instead of them being all or nothing.
- Be more forgiving with SOS commands. E.G. skip heap corruption and keep printing in !dumpheap. Allow for partial ranges, etc.
- Add Peter Sollich's inter-generational refence analysis to SOS
- Add the ability to dump segment regions to !maddress (solves the same problem as Maoni's !vadump parsing)
Managed heap related changes and improvements:
- Improve DML handling, improve TableOutput, make output consistent especially with respect to hex/non hex values
- Add filtering to various commands to only dump from certain memory ranges, segments, or heaps
- !eeheap - rewrite based on ClrMD
- !verifyheap - rewrite based on ClrMD
- !dumpheap - rewrite based on ClrMD
- !verifyobj - rewrite based on ClrMD
- !dumpruntimetypes
- !gcwhere - rewrite based on ClrMD
- !listnearobj - rewrite based on ClrMD
- !gcroot - rewrite based on ClrMD
- !findroots #3833
- !objsize - rewrite based on ClrMD
- !analyzeoom - rewrite based on ClrMD
- !traverseheap - rewrite based on ClrMD
- !threadpool - rewrite based on ClrMD
- !finalizequeue - rewrite based on ClrMD
- !dumpstackobjects - rewrite based on ClrMD
- Look into improving cancellation for managed commands.
- Finish consolidating complicated GC logic into ClrMD, all GC logic from SOS so there's only one place to update. Review and remove dead code from SOS.
Runtime work:
- Enumerating stack roots is extremely slow. This is due to DacStackReferenceWalker using heap enumeration to resolve interior pointers.
- ICorDebug doesn't seem to correctly enumerate all loader heaps
- Add new "VirtualAlloc" region enumeration so we properly find GC heap memory regions in !maddress and !eeheap
- Look for other places we should enumerate VirtualAlloc regions
Visual Studio work:
- Improve managed heap diagnostic performance
- [INVESTIGATE] Can we do more for native memory diagnostics in .Net applications?
Native heap related changes and improvements:
- Port new native heap analysis commands to SOS - !maddress, !findpointersin, etc
- Fix issues with enumerating loader heaps in ClrMD and SOS
- Re-test/clean up maddress after adding new VirtualAlloc region enumeration to the runtime
Type related improvements:
- [INVESTIGATE] Consider adding new SOS Dac functions for understanding TypeHandle instead of MethodTable. This would allow us to handle generics better in SOS/ClrMD.
Bugs to fix along the way:
- DML doesn't seem to work in SOS extension commands
- We should not limit VerifyObjectMember to objects on small object heap only #2199 - VerifyObjectMember shouldn't be limited to small object heap.
- !eeheap is reporting slightly inaccurate committed bytes. #3482 - EEHeap reports slightly inaccurate bytes
- [Regions] Avoid using allocation_started for USE_REGIONS #2483 - Don't use allocation_started with regions
-
listnearobjcan't confirm heap consistency with .NET 7 #3566 - ListNearObj prints errors with regions - should_check_bgc_mark and fgc_should_consider_object need to be updated for regions #2208 - should_check_bgc_mark and fgc_should_consider_object need to be updated for regions
- !threadpool does not work for desktop CLR #3818 - !threadpool doesn't work for desktop CLR
Cut, due to time:
Perfview work:
[INVESTIGATE] Consider moving memory graph and rooting related featuresAdd well-known native memory allocations kept alive by managed objects to the gcdump object graph.Extend the .gcdump format to include information about native memory regions.
SOS work:
[INVESTIGATE] Consider using PerfView's logic instead of how !gcroot works today.[INVESTIGATE] Consider adding a new command to SOS to generate a .gcdump[INVESTIGATE] Consider a new way of unit testing for SOS extension commands.For .Net Core, use PDBs to add more detail to commands, such as when the user sets a GC hard limitAdd !gchist command to dump out gc history - consider making this a dac API so ClrMD can use it
ClrMD work:
Do card table validation
Reacted by Jarret Shook and Alexey Sosnin
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
[-]Native and Managed Heap Improvements[/-][+]Post-Mortem Native and Managed Heap Improvements[/+][-]Post-Mortem Native and Managed Heap Improvements[/-][+]Post-Mortem Native and Managed Heap Diagnostics Improvements[/+]leculver commentedon May 10, 2023
Closing as completed as the only thing left was ClrMD3, which I removed from here since it's tracked by its own issue.