Taking Advantage of Garbage Collection

Jason Zhu 2021-02-19 12:09:58 +11:00
parent 1b458a4503
commit 3ab92d488f

@ -95,3 +95,7 @@ Differentiate btw Value & Reference:
How to check whether it's reference or value type:
* Place cursor in VSCode to type, Press `F12`, we can see metadata for the type. It will show whether it's `struct` or `class`
* The only exception is `String`, it's a reference type but often behave like a value type (i.e. passed as value in function by default)
## Taking Advantage of Garbage Collection
.NET runtime provide Garbage Collection service: keep track of objects created, recycle memeory by itself when nothing reference the obj.