What is a good visual tool for keeping track of memory management in C++...

What is a good visual tool for keeping track of memory management in C++? I want to know if any objects have been leftover in my program.
>Inb4 ddd, I want something modern.

All you need is RAII. And use the stack more

Make millions of them and check in the task manger.
Otherwise use Visual Studio.
Garbage collection only works with .NET C++

This you should be using smart pointers and move semantics. There's valgrind which IDEs implement

what does all that mean? genuinely curious, learning c++ and want to do it right

Stop calling new on everything.

Just make a big stack with malloc/new once for anything heavy and slide that pointer up and down it.

Don't listen to these RAII fags either. Don't use classes.

I should have been more specific, in my program, a text file is read where every word is stored in a line vector and every line Vector is stored in a page vector. So I need to make sure there are no orphan line vectors leftover. I was hoping a visual aid would help in this.

Are destructors really that hard for people to understand

>Don't listen to these RAII fags either
RAII is literally the point of using C++ over C.

When you say line vector and page vector, are you saying that this information is being stored in an std::vector? If so, the destructor should free the memory automatically when it goes out of scope...

lol, use a decent programming language where you don't have to deal with such silliness. I reccomend Python,.

Except that even C does RAII better because you can get return values from your constructors/destructors.

C doesn't do RAII at all.

Enclose any values created by new with an object that has a virtual destructor that destructs it with delete
Shared pointers are just pointers that contain a pointer and an internal reference counter that destructs the pointer when the count reaches zero. Unique pointers assures there's only one reference to a pointer at any given time

>having to explicitly call a c "destructor"
the whole point is that you don't have to do that

If you are explicitly calling destructor functions, it isn't RAII.

Valgrind

If a modern day AAA game had an infinite amount of development time, and perfect coding down to the assembly code, being able to run even without an operating system, what kind of performance improvement yields could we get using any other existing modern title as an example?

Just use Rust retard. Get with the times.

RAII is bullshit. The only reason to use it is because exceptions will cause memory leaks otherwise. But that's not a reason to use RAII - that's a reason to not use exceptions.

init/close functions > ctors and dtors.

>What is a good visual tool for keeping track of memory management in C++?

Self-explanatory, well-structured code.
Constructors and destructors can be pretty neat.

Also don't write it like Java. Java uses escape analysis to figure out whether something should go to the stack, or the heap. In C++ you can just explicitly always put things on the stack.

just use c

>Garbage collection only works with .NET C++
AFAIR that is known as C++/CLI

>This you should be using smart pointers and move semantics.
Just know that the compiler will not warn you about using something after calling std::move(x) with it.

>Except that even C does RAII better because you can get return values from your constructors/destructors.

You could also emulate that in C++ if you wanted to.

class shit_t {
public:
shit_t(int *ret_val) {
*ret_val = 0;
}

...

};

int status;
shit_t mypoo(&status);

if (status == 0)
...


Stupid meme language that offers literally nothing new. Do not advocate it.

>out params
disgusting