2.5. Memory management

The library performs caching of internally allocated objects. This helps reducing the overhead of memory allocation (which is a complex procedure and involves things like thread locking and defragmentation). The size of the cache pool can increase on the beginning of the application's networking activity, but it stabilizes and stops growing as the network load does. The library does not provide the application with a way to determine the size of the pool; assume that the memory management is optimal. The library does, however, provide a function to empty the pool of cached objects, which should only be used after burst operations which happen rarely. Cleaning the pool too often leads to poor performance.

The library uses standard malloc and free functions, and there is no way the application can specify its own memory allocation functions. This is made to guarantee consistent results of memory allocation by using a trusted source.