It's not a very simple question. There are not memory leaks in C + + understanding. Memory leaks in Java have a slightly different mechanism of occurrence, that's what hi meant
This tool is often used by beginners.
I can posovetovt use built-in tools to detect leaks. They do not provide 100% protection, but they can help find memory leaks.