Top: Programming: C / C++ : Garbage Collection in C#
Garbage Collection in C#
A significant advantage of C# when compared to C++ is the memory management capabilities of the C#. The programmer need not worry about memory management; the garbage collector is assigned this operation on the programmer’s behalf. You will probably know that value data types are stored on the stack while reference data types are stored on the managed heap. The stack stores data value types that are not members of objects. Also, in C# it is always the case that if variable a goes into scope before variable b, then b will go out of scope first. For example, if you declare some variables in a method, these variables will go out of scope when the method ends. However, it maybe sometimes that you need to keep these variables long after the method/function ended. This happens for all data declared with the new operator, the reference types. All reference types are stored in the managed heap, which is under the control of garbage collector.
ADVERTISMENT
More C / C++ Tutorials for Programming
Top: Programming: C / C++: Another ASM tutorial
Top: Programming: C / C++: Templates in c++
Top: Programming: C / C++: Functions in C
Top: Programming: C / C++: Buffer using allegro c++
Top: Programming: C / C++: Containers in C++
Top: Programming: C / C++: Console Calculator
Top: Programming: C / C++: Function Prototypes
Top: Programming: C / C++: C++ Language Tutorial
» Hardware reviews
SOFTutorials
- » Add a tutorial (and get rewarded)
- » Login
- » Register (3D Kingdom)
- » About/FAQ/Contact
Highest Rated
![]() |
3D Shining Text - Draw 3D lighting text in photoshop ...
Rated: |
![]() |
Fireworks in Photoshop - Draw nice fireworks with Tool Brushes and Blending options. Very easy but n...
Rated: |
![]() |
3D New Year Text in Photoshop - Make 3D text inspired by 20th Century Fox logo. ...
Rated: |
![]() |
Exploding planet in Photoshop - Draw Exploding Earth using tools and filters. ...
Rated: |
Most Popular
![]() |
Improving capture performance in Windows Movie Maker - Easiest way to improve Capture performance in Windows MovieMaker. Follow th...
Rated: |
![]() |
V-ray Glass Material - If you want very realistic render you need to use V-ray Render plugin. In t...
Rated: |
![]() |
Getting Started with PowerPoint - This tutorial describes tasks that you do almost every time you run the pro...
Rated: |
![]() |
The Matrix Raining Code Video Tutorial - Tutorial showing how to create and animate the raining code effect from the...
Rated: |








No comments at this moment