Automatic vs manual memory management

Romulo

Member
Joined
Dec 11, 2013
Messages
8
Programming Experience
1-3
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?
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,273
Location
Sydney, Australia
Programming Experience
10+
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