The "Weak Event" Pattern in C#
Explains the memory leak issue with C# events and demonstrates how to implement the Weak Event pattern using weak references.
Explains the memory leak issue with C# events and demonstrates how to implement the Weak Event pattern using weak references.
Explains the .NET 5 SuppressGCTransition attribute for optimizing P/Invoke performance, including benchmarks and important caveats.
Analyzes the performance and memory impact of Java's ArrayList.clear() method, explaining its internal workings and potential memory retention.
Explains the differences and use cases for Span<T>, Memory<T>, and ReadOnlySequence<T> in C# for high-performance memory access.
Explains the risks of using .NET performance counters and how to read them directly from the registry for reliability.
Explains the pitfalls of comparing ReadOnlySpan<char> objects in C#/.NET, highlighting differences from string comparison due to memory representation.
Explains why PyTorch multi-process data loaders cause massive RAM duplication and provides solutions to share dataset memory across processes.
Explores how to mutate Python tuples, which are normally immutable, by using the C Foreign Function Interface (ctypes) to directly manipulate memory.
Explains how TigerBeetle, a database written in Zig, operates using only static memory allocation for predictability and performance.
Explores using the Hare programming language for kernel development, focusing on low-level memory management and boot information structures.
Explains the .NET Garbage Collector's compacting phase, its performance benefits, and the Large Object Heap (LOH).
A deep dive into how the .NET Garbage Collector works, explaining its phases, generations, and impact on application performance.
Explains why using finalizers in C# is problematic and advocates for IDisposable for deterministic resource cleanup.
Explores the performance differences between passing by value and by reference in C#, focusing on structs, copying costs, and dereferencing overhead.
Explores four methods for creating arrays in C#, comparing performance and use cases for new, ArrayPool, GC.AllocateArray, and GC.AllocateUninitializedArray.
Explains the differences between struct, readonly struct, ref struct, and record struct in C#, focusing on usage, limitations, and memory management.
Explores two methods for estimating JSON serialization size in .NET: a 100% accurate LengthOnlyStream and a faster, approximate JsonEstimator.
Explains the differences between loadView and viewDidLoad in UIKit, focusing on memory management and weak vs. strong subviews.
Explains how to calculate the size of a fixed-size array in C++ using the sizeof operator and demonstrates its use in a loop.
Explains memory management in C#, covering the Heap, Stack, and the performance implications of boxing and unboxing operations.