C#内存管理技巧_学会如何掌握垃圾回收器

后端开发
浏览量:6
发布时间:2026-01-11T13:59:17.000Z
更新时间:2026-01-11T14:40:24.244Z

课程介绍

课程概述

本课程旨在帮助 C# 开发人员了解和掌握托管内存管理的技术,重点关注垃圾回收器 (GC)。

课程目标

  • 了解托管内存管理的基本原理
  • 深入探讨垃圾回收器的运作方式
  • 探索不同的垃圾回收算法
  • 学习如何优化代码以减少 GC 压力
  • 了解如何处理未托管资源

课程大纲

模块 1:托管内存管理基础

  • 托管和非托管代码
  • CLR 内存模型
  • 引用类型和值类型

模块 2:垃圾回收器概述

  • GC 的作用和目标
  • 代际收集和标记-清除算法
  • 终结器和析构函数

模块 3:GC 算法和计时

  • 标记-压缩算法
  • 并发 GC
  • 理解 GC 周期和性能影响

模块 4:优化内存管理

  • 使用引用计数
  • 避免内存泄漏
  • 优化对象创建和销毁
  • 使用 WeakReference、FinalizableDisposable 等模式

模块 5:处理未托管资源

  • SafeHandle 和 IDisposable
  • 使用 Finalize 方法
  • 理解 RAII 和 C# 中的智能指针

模块 6:高级 GC 主题

  • 弱引用和强引用
  • 使用 Large Object Heap
  • 调试 GC 问题

课程适合人群

  • 具有 C# 编程经验的开发人员
  • 希望优化内存管理并提高代码性能的开发者
  • 对垃圾回收器内部原理感兴趣的任何人

课程时长

大约 6-8 小时,根据个人的学习进度而异。

课程形式

  • 视频讲座
  • 代码演示
  • 练习和测验

课程完成后

完成本课程后,您将:

  • 对托管内存管理有一个深入的理解
  • 了解 GC 如何工作并优化其性能
  • 能够识别和解决内存泄漏和其他 GC 问题
  • 了解处理未托管资源的最佳实践

课程目录

/15-024-C#内存管理技巧_学会如何掌握垃圾回收器/
│├─01 – Introduction
│├─02 – Fundamentals Of The .NET Framework
│├─03 – A Detailed Look At Garbage Collection
│├─04 – Simple Tricks To Improve Memory Allocation In Your Code
│├─05 – Final Words
01 – Introduction/
│├─001 Course Introduction.srt 4.3KB
│├─001 Course Introduction_en.srt 4.6KB
│├─001 Course Introduction.mp4 36MB
│├─002 Meet Your Instructor.srt 3.9KB
│├─002 Meet Your Instructor_en.srt 4KB
│├─002 Meet Your Instructor.mp4 91.1MB
│├─003 Introduction To .NET Memory Management.mp4 47.2MB
│├─003 Introduction To .NET Memory Management.srt 4.1KB
│├─003 Introduction To .NET Memory Management_en.srt 4.5KB
│├─004 Windows, OSX or Linux.mp4 62.4MB
│├─004 Windows, OSX or Linux.srt 3.5KB
│├─004 Windows, OSX or Linux_en.srt 3.5KB
│├─005 Background Info – About Me.html 2.6KB
02 – Fundamentals Of The .NET Framework/
│├─001 Section Introduction.srt 873byte
│├─001 Section Introduction_en.srt 943byte
│├─001 Section Introduction.mp4 4.2MB
│├─002 The Stack.mp4 95.7MB
│├─002 The Stack.srt 6.3KB
│├─002 The Stack_en.srt 6.7KB
│├─003 The Heap.srt 4.8KB
│├─003 The Heap_en.srt 5.2KB
│├─003 The Heap.mp4 39.2MB
│├─004 Value Types.mp4 32.5MB
│├─004 Value Types.srt 5.5KB
│├─004 Value Types_en.srt 5.7KB
│├─005 Reference Types.srt 5.1KB
│├─005 Reference Types.mp4 44.9MB
│├─005 Reference Types_en.srt 5.3KB
│├─006 Boxing And Unboxing.srt 5.7KB
│├─006 Boxing And Unboxing_en.srt 6KB
│├─006 Boxing And Unboxing.mp4 52.1MB
│├─007 Section Recap.srt 3KB
│├─007 Section Recap.mp4 32.2MB
│├─007 Section Recap_en.srt 3.3KB
03 – A Detailed Look At Garbage Collection/
│├─001 Section Introduction.srt 1.5KB
│├─001 Section Introduction.mp4 10.2MB
│├─001 Section Introduction_en.srt 1.6KB
│├─002 Garbage Collection In .NET.mp4 329MB
│├─002 Garbage Collection In .NET.srt 13.7KB
│├─002 Garbage Collection In .NET_en.srt 14.8KB
│├─003 How To Optimise Your Code For Garbage Collection.mp4 204.6MB
│├─003 How To Optimise Your Code For Garbage Collection.srt 15.5KB
│├─003 How To Optimise Your Code For Garbage Collection_en.srt 16.6KB
│├─004 Finalisers in .NET.srt 13.2KB
│├─004 Finalisers in .NET_en.srt 14.1KB
│├─004 Finalisers in .NET.mp4 90.1MB
│├─005 The Dispose Pattern.mp4 207.4MB
│├─005 The Dispose Pattern.srt 12.3KB
│├─005 The Dispose Pattern_en.srt 13.3KB
│├─006 Section Recap.srt 3.2KB
│├─006 Section Recap_en.srt 3.6KB
│├─006 Section Recap.mp4 80.7MB
04 – Simple Tricks To Improve Memory Allocation In Your Code/
│├─001 Section Introduction.srt 1.1KB
│├─001 Section Introduction_en.srt 1.2KB
│├─001 Section Introduction.mp4 7.5MB
│├─002 Avoid Boxing And Unboxing.mp4 157.9MB
│├─002 Avoid Boxing And Unboxing.srt 8.9KB
│├─002 Avoid Boxing And Unboxing_en.srt 9.7KB
│├─003 Do Not Concatenate Strings.mp4 341.3MB
│├─003 Do Not Concatenate Strings.srt 12.4KB
│├─003 Do Not Concatenate Strings_en.srt 13.1KB
│├─004 Use Structs Instead Of Classes.mp4 423.1MB
│├─004 Use Structs Instead Of Classes.srt 14.7KB
│├─004 Use Structs Instead Of Classes_en.srt 15.9KB
│├─005 Always Pre-Size Collections.mp4 82.5MB
│├─005 Always Pre-Size Collections.srt 9.8KB
│├─005 Always Pre-Size Collections_en.srt 10.2KB
│├─006 Avoid Calling ToList In LINQ Expressions.mp4 379MB
│├─006 Avoid Calling ToList In LINQ Expressions.srt 14.4KB
│├─006 Avoid Calling ToList In LINQ Expressions_en.srt 15.2KB
│├─007 Can We Modify Strings Directly.html 11KB
│├─008 Section Recap.srt 3.5KB
│├─008 Section Recap_en.srt 3.7KB
│├─008 Section Recap.mp4 76.5MB
05 – Final Words/
│├─001 Course Recap.mp4 9.8MB
│├─001 Course Recap.srt 1.7KB
│├─001 Course Recap_en.srt 1.8KB
│├─002 Bonus Offer.html 3.1KB

课程购买
课程价格
金币6
60金币
限时优惠
销量:
0