書いているいくつかの C コードをテストしていたところ、多くのメモリ リークがあることがわかったので、それらがどこから発生しているのかを確認したかったのです。私が持っていたすべてのコードは次のとおりです。
int main() {
return 0;
}
何もしない単純なメインだけで、これらすべてのメモリリークが発生しました。
==38882== HEAP SUMMARY:
==38882== in use at exit: 58,678 bytes in 363 blocks
==38882== total heap usage: 514 allocs, 151 frees, 62,544 bytes allocated
==38882==
==38882== LEAK SUMMARY:
==38882== definitely lost: 8,624 bytes in 14 blocks
==38882== indirectly lost: 1,168 bytes in 5 blocks
==38882== possibly lost: 4,925 bytes in 68 blocks
==38882== still reachable: 43,961 bytes in 276 blocks
==38882== suppressed: 0 bytes in 0 blocks
==38882== Rerun with --leak-check=full to see details of leaked memory
==38882==
==38882== For counts of detected and suppressed errors, rerun with: -v
==38882== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
このコードを大学のコンピューターで実行すると、メモリ リークは発生しません。ローカル マシンにこれほど多くのメモリ リークを引き起こしているものはありますか?