IDisposable Best Practices for C# Developers
.NET takes care of memory management for you, right? Mostly. But the Garbage Collector needs your help and that's where IDisposable comes in. This course will teach you how to use it correctly to prevent strange errors and crashes in your apps.
What you'll learn
IDisposable is the only part of the platform where .NET asks for your help. If you don't use IDisposable correctly, the .NET Garbage Collector can't manage memory properly, so your app won't run efficiently, it may have strange errors, and it will eventually crash.
In this course, IDisposable Best Practices for C# Developers, you'll learn to manage object lifetimes and keep your apps running lean. First, you'll see what goes wrong if you don't dispose of objects, and how that can bring your apps down. Then, you'll explore the Garbage Collector to understand how .NET cleans up unused objects. Finally, you'll discover how to implement IDisposable throughout a distributed .NET application. When you’re finished with this course, you’ll have the skills and knowledge of managed and unmanaged memory to keep your .NET apps performing under any load.
Table of contents
- Introducing the Garbage Collector 3m
- How and When the GC Runs 4m
- Demo: Understanding Garbage Collection 5m
- Demo: Memory and Object Profiling 4m
- Managing the Garbage Collector's Workload 4m
- Demo: Implementing IDisposable 3m
- Demo: The Full Dispose Pattern 3m
- How the GC Uses Finalizers 3m
- Demo: IDisposable and Finalizers 3m
- Demo: Cleaning up Unmanaged Resources 3m
- Module Summary 5m
- Approaches for Finding and Fixing Disposable Issues 3m
- Demo: Finding Problems with Object Lifetimes 6m
- Demo: Fixing Problems with Static Analysis and Profiling 11m
- Using Static Analysis to Find IDisposable Issues 5m
- Demo: Managing Object Lifetime in Modern Apps 6m
- Demo: Fixing Lifetime Problems with Dependency Injection 7m
- Disposable Objects and Dependency Injection Special Cases 4m
- Using IAsyncDisposable with Asynchronous Streams 7m
- Module Summary 2m