# Slow Chat Archives > Slow Chat: Visual C++: Yesterday, Today, and Tomorrow >  [RESOLVED] Why .Net not use smart pointers instead of GC?

## CBasicNet

Hi, my question is why didn't .Net use smart pointers instead of Garbage Collector to do memory management?

In that way, the memory will reclaimed automatically when there is no variable reference the object, and memory usage will be always compact, and there is no need for a garbage collector program running.

Thanks for answering my query!

----------


## gstercken

> Hi, my question is why didn't .Net use smart pointers instead of Garbage Collector to do memory management?


Although I'm not in the VC++ team, I can answer that for you:  :Wink: 

The reason is that smart pointers (or more generally speaking: object reference counting), as used in VB 6, fail to handle the case of circular object references - they will normally lead to orphaned resources. That's where garbage collection comes in (not only with regard to .NET, but in a very general sense: It's the reason why GC had to be invented after all, and is also used by other languages / environments, like Smalltalk for example).

----------


## joncaves

Hi: I'm Jonathan Caves and I'm a developer on Visual C++ compiler team.

The reason that the .NET runtime uses a garbage collector is that it is desgined as multi-language runtime: as well as C++ it supports VB, C#, Eiffel, Cobol, and other languages. So you can't really use a C++ specific technology like smart-pointers (which require templates) for a language neutral technology like the .NET runtime. Having said that I am more that certain that the .NET runtime itself, which is mostly written in C++, makes use of smart pointers internally.

----------

