Answer the question
In order to leave comments, you need to log in
How to determine that memory is leaking? How to get the size of the memory occupied by an instance of a class?
Two questions:
1. Is there any regular way to determine that you forgot delete somewhere and the memory is leaking.
2. Is there a way to get the size of the memory that the class instance currently occupies.
Answer the question
In order to leave comments, you need to log in
1. In addition to the free valgrind, there is also intel vtune that works much faster, but costs money.
2.sizeof(). But it will only return the size of the internal data members of the class. If you additionally allocate dynamic memory in your class, then sizeof will not take this into account. Except you, no one knows how much memory a class eats and how to calculate it correctly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question