Automatic vs manual memory management


Dec 11, 2013
Programming Experience
In C sharp is possible to have two ways of memory management.
My question is for automatic use of memory management instead of manual, represents lower performance?
C# uses automatic memory management. You can tell the garbage collector when to reclaim unused memory but, unless you're using unsafe code, you never explicitly allocate memory, unlike in C/C++. C/C++ is preferred in many situations because its lower-level nature can provide better performance but there are many situations where that level of performance is of no real value, in which case the ease of use and productivity provided by languages like C# are of greater advantage. Automatic memory management is one of the features that provides greater productivity because it frees you from having to worry about when to allocate and deallocate memory and fixing the bugs that arise when you don't do so properly.
Top Bottom