How to learn memory usage in C ++

I have a C ++ program running Visual Studio 2010, how can I control the memory usage of my program? Is there a simple API, for example, I can call clock_t start1 and start1 = clock(); to track the use of time by my program. Thanks:)

+6
source share
1 answer

Memory management is not a simple problem like synchronization, and it is definitely more difficult to track.

I recommend looking at other similar StackOverflow posts to get started:

How to analyze program memory usage in Visual Studio 2010?

How do you detect / avoid memory leaks in your (unmanaged) code?

track C ++ memory allocation

They should help you solve any of your specific memory problems, regardless of whether it searches for a memory leak, overwrites the end of the allocated buffer, or simply keeps track of how much memory you have allocated.

+6
source

Source: https://habr.com/ru/post/913378/


All Articles