Writing a .NET Garbage Collector in C# - Part 10: Finalizers
Using NativeAOT to write a .NET GC in C#. In this part, we add support for finalization.
Recent content on minidump.net
Using NativeAOT to write a .NET GC in C#. In this part, we add support for finalization.
Using NativeAOT to write a .NET GC in C#. In this part, we look at what the GC must do to properly handle frozen segments, and we change the allocation strategy to make it more efficient.
Using NativeAOT to write a .NET GC in C#. This time, we look at what interior pointers are and why they’re so challenging for the GC. We also introduce the concept of brick table.
Sometimes the most convincing performance gains deserve a second look. A reminder that profiling data can be more subtle than it first appears.
Using NativeAOT to write a .NET GC in C#. In the seventh part, we scan and update the handles during the mark phase of the garbage collection.
Using NativeAOT to write a .NET GC in C#. In the sixth part, we start implementing the mark phase of the garbage collection.
A short investigation that showcases one of the most common problem faced when writing a profiler.
In this article, we see what are function hooks, and how to use them in .NET with Silhouette. We also learn how to statically link a library with NativeAOT.
A walkthrough of how I built a custom profiler to measure UI responsiveness, using .NET and Silhouette.
Using NativeAOT to write a .NET GC in C#. In the fifth part, we learn how to decode the GCDesc to find the references of a managed object.
Pro .NET Memory Management 2nd Edition is available! What should you expect from it? Should you buy it if you already own the 1st edition?
Using NativeAOT to write a .NET GC in C#. In the fourth part, we see how walk the heap and how to keep track of allocation contexts.
Using NativeAOT to write a .NET GC in C#. The third part adds some tooling to inspect the objects stored on the heap.
Using NativeAOT to write a .NET GC in C#. The second part builds the simplest possible GC that can run basic .NET applications.
First part of a series of articles about writing a .NET Garbage Collector in C# using NativeAOT. This part sets the expectations and setups the project, dealing with the first difficulties.
Part 5 of the series about using NativeAOT to write a .NET profiler in C#. We have all the foundations, we’re finally writing an actual profiler.
A look into how to use Windows Error Reporting to collect crash information for your .NET apps.
When the tool you write to debug crashes crashes. A story of advanced printf-debugging.
A new tool to visualize the activity of the .NET garbage collector.
Using unsafe hacks to walk the managed heap from within a .NET application, without relying on the debugging API.
Exploring a little-known API allowing to allocate managed objects outside of the managed heap.
A deep dive into the weird tricks used by the .NET allocator to align arrays of doubles.
Deep-dive into the SuppressGCTransition attribute introduced in .NET 5.
Part 4 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we learn how to call methods from ICorProfilerInfo .
A surprising error occuring when using C# 7.3 with partial trust.
Part 3 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we write a source generator to automatically generate the boilerplate code needed to implement the ICorProfilerCallback interface.
A faster and safer way to read .NET performance counters from within.
Part 2 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we improve the code from the previous article by using instance methods instead of static methods.
GC.KeepAlive may not work the way you intend when using it in async methods.
The C# specification indicates that function pointers can only be used on static methods. This article explains why.
Part 1 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we will see how to mimic a COM interface in C#.
Using NativeAOT and ClrMD to write a native WinDbg extension in .NET.
How to find an instance of System.Threading.Thread by id in WinDbg, with a .NET Core memory dump.
This article explains how AsyncLocal values are stored in .NET and how to retrieve them from a memory dump.
Browse memory structures from a memory dump in C#, just like you would with ClrMD, but in a more fluent way.
How to tell PerfView to stop grouping unresolved functions under the same “?!?” label.
Digging into a bug in the .NET ARM64 runtime, learning about dispatch stubs, and using that knowledge to diagnose a NullReferenceException.
This story begins when one of our integrations tests started got stuck on one PR that seemingly impacted unrelated code. This is a nice excuse to cover some concepts I haven’t touched in my previous articles, such as downloading the .NET symbols on Linux.
This is the second part of an investigation where I tried to understand why an application was randomly crashing with an AccessViolationException . This part starts when, as I ran out of easy things to try, I decided to map the assembly code of the IsLockHeld method to the original C++ code to understand exactly where it crashed.
Investigating a crash in a .NET application, caused by an AccessViolationException when inspecting the state of a lock.
In this series of article, we’re retracing how I debugged an InvalidProgramException , caused by a bug in the Datadog profiler, from a memory dump sent by a customer. This is the last part of the investigation, about figuring out what is wrong with the IL code.
In this series of article, we’re retracing how I debugged an InvalidProgramException, caused by a bug in the Datadog profiler, from a memory dump sent by a customer. In this part, we extract the dynamic IL from the memory dump.
In this series of article, we’re retracing how I debugged an InvalidProgramException, caused by a bug in the Datadog profiler, from a memory dump sent by a customer. The first part of the investigation is an introduction to using a memory dump from a .NET application to find the information you seek.
Even with years of experience, WebRequest managed to surprise me.
Using startup hooks to automatically fetch GC metrics from any .net core application.
How to inspect arbitrary values in the memory of a .net process on Linux… And find an unexpected bug in the process.
Non-exhaustive list of code patterns to avoid in C#, either because they are risky or perform poorly.
Explaining the ThreadPool starvation issue, and how it can be made worse by the way work-items are queued.
Inspiration for quarantine days: how to connect a Raspberry Pi to a training bike to stream the speed to a computer and pause a video when below 20 km/h
Leveraging the async machinery to transparently switch to the UI thread when needed.