3 ms·
Ask HN: Memory leaks in C/C++ Application debugger tool?
I have a application which is written in C/C++, when I try to run Valgrind or sanitizer for detecting mem leaks it shows less leaks. But memory is keep growing when the application is running for longer time.
- jay-barronville 2y agoWhy not override the allocator functions and track the memory allocations and deallocations yourself? You can do pretty much anything at that point (e.g., you can track memory allocations and deallocations at only the specific levels you care about)…
- b20000 2y agoi recommend this approach as well, i've done this to keep track of statistics
- iExploder 2y agothis is such a generic statement... as long as you de-allocate on exit it wont show up as leak, that doesnt mean the app is not continuously allocating more memory, whether as bug or for a valid reason is up to you to find out... you can try https://gperftools.github.io/gperftools/heapprofile.html https://gperftools.github.io/gperftools/heapprofile.html setup HEAP_PROFILE_TIME_INTERVAL and look at the reports to see which code lines keep allocating memory...
- TreasurePalace 2y ago[dead]