Take a look at the Memory Management docs 63 which explain how the caching memory allocator works.
The last section explains how the env variable can be used to prevent fragmentation in case your workload is suffering from it.