Memory alignment of doubles in C#
Explores the performance impact and technical details of memory alignment for double arrays in .NET, including benchmarks.
Kevin Gosse is a Microsoft MVP and .NET expert specializing in performance, debugging, and memory management.
56 articles from this blog
Explores the performance impact and technical details of memory alignment for double arrays in .NET, including benchmarks.
Explains the .NET 5 SuppressGCTransition attribute for optimizing P/Invoke performance, including benchmarks and important caveats.
Explains how to write a .NET profiler in C# by implementing ICorProfilerInfo to call native methods from a managed wrapper.
Explains a .NET Framework VerificationException when using readonly structs in partial trust environments and the underlying IL safety checks.
Part 3 of a series on writing a .NET profiler in C#, focusing on creating a source generator to automate boilerplate code for the profiling API.
Explains the risks of using .NET performance counters and how to read them directly from the registry for reliability.
A technical guide on implementing a .NET profiler in C#, focusing on mapping COM objects to .NET instances and using UnmanagedCallersOnly.
Explains a subtle bug where GC.KeepAlive fails to prevent garbage collection of a delegate in async code involving native methods.
Explains why function pointers fail with instance methods and large structs in C#, detailing a stack corruption issue.
Explores writing a .NET profiler in C# using NativeAOT to overcome traditional C++ limitations and self-profiling issues.
Explains how to write native WinDbg debugging extensions using C# and .NET 7's NativeAOT feature for better interoperability.
A technical guide on how AsyncLocal values are stored in .NET and the process of retrieving them from a memory dump using WinDbg.
A technical guide on using WinDbg to locate and switch to a specific managed thread by its ID in a .NET memory dump.
Introducing DynaMD, a C# library that simplifies .NET memory dump analysis with a more natural syntax than ClrMD.
How to disable PerfView's grouping of unresolved CPU frames under '?!?' to better analyze performance bottlenecks.
A deep dive into debugging a NullReferenceException crash on ARM64 Linux, revealing a missing null check in the .NET runtime's exception handling.
A technical walkthrough of debugging a native deadlock in a .NET application running on Linux, using tools like dotnet-dump and analyzing thread stacks.
A deep dive into debugging an AccessViolationException in .NET's ObjectNative::IsLockHeld method, tracing orphaned locks in an Orchard application.
A deep-dive investigation into an AccessViolation crash in the .NET runtime's ObjectNative::IsLockHeld method, encountered while testing a tracer.
Final part of debugging an InvalidProgramException caused by a profiler bug, focusing on analyzing faulty IL code from a memory dump.