Is there a way to control heap usage in C ++ / MacOS?

I'm afraid that part of my code is causing a memory leak, and I'm not sure how to check it. Is there a tool or something for MacOS X?

thanks

+3
source share
4 answers

Apple has a good description of how to use MallocDebug in OS X on its developer pages.

+2
source

Yes - an application called MallocDebug that is installed as part of the Xcode package.

You can find it in the folder /Developer/Applications/Performance Tools.

+4

, UNIX ... .

, . , , , , . Valgrind MallocDebug ..

, / RAII, , ?;)))

+1

BEST PERIOD tool for memory errors, leaks, etc. - Valgrind. Start here . You do not need to do anything special in your code, and this will tell you where the memory was allocated (with a full stack trace, even in C). In addition, it will detect a write to free memory, uninitialized memory usage and much more.

0
source

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


All Articles