I can give you a more specific idea if you have problems with memory allocation, such as memory leak, of not-enough-memory problems. The type of product you need is called "memory debugger".
You can find the one suitable for you from this list:
At least some of these products are open-source.
Another (but not alternative, it could be the additional) approach is the validating library which you can use during run-time. Such library intercepts/replaces C++ memory allocation operations and count the balance. It can pinpoint the object where the memory is not completely released. Unfortunately, I cannot point you a particular 3rd-party library which you can use with contemporary C++ compilers, but if you use Visual Studio, you can use its debugger along with CRT libraries to detect and pinpoint memory leaks. Please see:
You can improve your memory handling experience and reduce amount of manual work if you use some more advanced techniques like automatic pointers
, which provide limited garbage collection
facility for pointers: