Valgrind сообщает, что whois
выделяет много памяти, даже если я просто прошу его версию.
$ valgrind whois --version
==18086== Memcheck, a memory error detector
==18086== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==18086== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==18086== Command: whois --version
==18086==
Version 5.2.11.
Report bugs to <md+whois@linux.it>.
==18086==
==18086== HEAP SUMMARY:
==18086== in use at exit: 65 bytes in 1 blocks
==18086== total heap usage: 56 allocs, 55 frees, 15,171 bytes allocated
==18086==
==18086== LEAK SUMMARY:
==18086== definitely lost: 0 bytes in 0 blocks
==18086== indirectly lost: 0 bytes in 0 blocks
==18086== possibly lost: 0 bytes in 0 blocks
==18086== still reachable: 65 bytes in 1 blocks
==18086== suppressed: 0 bytes in 0 blocks
==18086== Rerun with --leak-check=full to see details of leaked memory
==18086==
==18086== For counts of detected and suppressed errors, rerun with: -v
==18086== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Экспериментируя с несколькими другими утилитами, я обнаружил, что это является общим для многих из них: они выделяют много памяти для простых команд. Просто посмотрите на GCC!
$ valgrind gcc --version
==18141== Memcheck, a memory error detector
==18141== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==18141== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==18141== Command: gcc --version
==18141==
gcc (Ubuntu 5.3.1-14ubuntu2.1) 5.3.1 20160413
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
==18141==
==18141== HEAP SUMMARY:
==18141== in use at exit: 116,660 bytes in 62 blocks
==18141== total heap usage: 171 allocs, 109 frees, 135,692 bytes allocated
==18141==
==18141== LEAK SUMMARY:
==18141== definitely lost: 4,552 bytes in 13 blocks
==18141== indirectly lost: 0 bytes in 0 blocks
==18141== possibly lost: 0 bytes in 0 blocks
==18141== still reachable: 112,108 bytes in 49 blocks
==18141== suppressed: 0 bytes in 0 blocks
==18141== Rerun with --leak-check=full to see details of leaked memory
==18141==
==18141== For counts of detected and suppressed errors, rerun with: -v
==18141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)