Appendix A. Appendix
malloptis a library call that allows a program to change the behavior of the malloc memory allocator.
Example A.1. Allocator heuristics
mmap. For the later, it attempts to allocate with
malloptallows the developer to override those limits.
mallopt (M_ARENA_MAX, 8);
malloc_trimis a library call that requests the allocator return any unused memory back to the operating system. This is normally automatic when an object is freed. However, in some cases when freeing small objects,
glibcmight not immediately release the memory back to the operating system. It does this so that the free memory can be used to satisfy upcoming memory allocation requests as it is expensive to allocate from and release memory back to the operating system.
malloc_statsis used to dump information about the allocator's internal state to
mallinfois similar to this, but it places the state into a structure instead.
malloptcan be found at http://www.makelinux.net/man/3/M/mallopt and http://www.gnu.org/software/libc/manual/html_node/Malloc-Tunable-Parameters.html.