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!