Heapy icon indicating copy to clipboard operation
Heapy copied to clipboard

Heapy reports 0 allocations

Open iamsergio opened this issue 5 years ago • 2 comments

#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

iamsergio avatar May 26 '19 14:05 iamsergio

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) ?

iamsergio avatar May 26 '19 15:05 iamsergio

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.

lukedodd avatar May 28 '19 09:05 lukedodd