意図的にメモリ リークを作成するために、次のコードを記述しました。
#include <windows.h>
int main(int argc, char* argv[])
{
while(1)
{
char *ch1 = new char[10];
char *ch2 = new char[5];
char *ch3 = new char[2];
Sleep(5);
}
return 0;
}
LeakDiag を使用してログを取得し、 LDGrapherを使用して次のグラフを作成しました。
さて、私の質問は、リーク グラフに 3 つのアドレスしか表示されないのはなぜですか? で新しいポインタを作成し続けているwhile(1)
ため、多くのアドレスでメモリ リークが発生していますか?