glibc中的malloc实现: The main properties of the algorithms are:* For large (>= 512 bytes) requests, it is a pure best-fit allocator, with ties normally decided via FIFO (i.e. least recently used).* For small (<= 64 bytes by default) requests, it is a
Valgrind Valgrind作为一个免费且优秀的工具包,平时大部分人可能都是使用valgrind检测内存问题,如内存泄露,越界等. Valgrind工具包包含多个工具,如Memcheck,Cachegrind,Helgrind, Callgrind,Massif.下面分别介绍个工具的作用: Memcheck 使用未初始化的内存 (Use of uninitialised memory) 使用已经释放了的内存 (Reading/writing memory after it has been