필자가 작성한 일부 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)
난 더 메모리 누수가 없다 . 이 많은 메모리 누출의 원인이되는 내 로컬 컴퓨터에 무언가가 있습니까?
사용중인 설정은 무엇입니까? OS? 컴파일러? –
나는 산사를 쓰고있는 맥을 사용하고있다. 나는 gcc로 컴파일 중이다. – iKTiKZ
@KatieCalabro OS X 및 특히 Mountain Lion의 Valgrind는 ** 매우 버그가 있습니다. ** 오진 가능성이 가장 높습니다. –