Chapter 4: Memory Management
In this chapter, we will be looking at object generations and how to avoid memory issues, followed by a discussion on strong and weak references. Then, we will look at finalization and how we can suppress finalization by implementing the IDisposable pattern to clean up managed and unmanaged resources. Finally, we will take a high-level look at ways to avoid memory leaks.
In this chapter, we will be covering the following topics:
- Object generations and avoiding memory issues: In this section, we learn about object generations and System.OutOfMemoryException. We learn how to predict out-of-memory errors before they happen by using the System.Runtime.MemoryFailPoint class.
- Understanding long and short weak references ...
Get High-Performance Programming in C# and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.