# Memory Managment and Exception Handling

**URL:** <https://forum.kirupa.com/t/memory-managment-and-exception-handling/251361>\
**Category:** programming\
**Created:** [February 7, 2008, 6:23pm UTC](https://forum.kirupa.com/t/memory-managment-and-exception-handling/251361 "2008-02-07T18:23:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![complete](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@complete](https://forum.kirupa.com/u/complete)\
**Post date:** [February 7, 2008, 6:23pm UTC](https://forum.kirupa.com/t/memory-managment-and-exception-handling/251361/1 "2008-02-07T18:23:04Z")

</div>

I wonder about Memory Managment and Exception Handling in C#.

I know that C# has its own “garbage collection” to prevent memory leaks. How does this work and how does someone code accordingly for this? I see that there is still the “new” statement in C# that C++ has for allocating memory for a new object or pointer. Does the “garbage collection” mean that you do not have to have a corresponding “delete” for every “new” statement?

Do you still have to account for exception handling in C#? Do you still need the “try…catch… throw” blocks? Are them implimented the same way as in C++?
