Heapy
Heapy copied to clipboard
Heapy reports 0 allocations
#include <iostream>
#include <string>
struct Foo {
char v [1024 * 1024 * 300]; // 300 Mb
Foo() {
std::cout << "Constructed\n";
}
~Foo() {
std::cout << "Deleted\n";
}
};
int main()
{
new Foo();
malloc(1024 * 1024 * 300);
std::string *s = new std::string("test");
std::cout << *s << "\n";
return 0;
}
Results in:
Printing top allocation points. Top 0 allocations: 0Mb Total allocations: 0Mb (difference between total and top 0 allocations : 0Mb)
Test compiled with:
cl.exe main.cpp
Ran with:
Heapy_x64.exe main.exe
Tested Visual Studio 2013 and 2019
Ok, it was because /Zi flag was missing (which generates the .pdb file).
Couldn't Heapy still print that 600MB was leaked, and just not print the stack-trace (as there's missing debug symbols) ?
Yes it could.
I'd be happy to accept a PR. Or I may look into it next time I work on heapy.
I'm pretty sure I've seen heapy show stack traces with some missing symbols so the issue might be a little subtle.