Memory Pool Vs Malloc
Benefits
- Memory pools allow memory allocation with constant execution time (no fragmentation). The memory release for thousands of objects in a pool is just one operation, not one by one if malloc is used to allocate memory for each object.
- Memory pools can be grouped in hierarchical tree structures, which is suitable for special programming structures like loops and recursions.
- Fixed-size block memory pools do not need to store allocation metadata for each allocation, describing characteristics like the size of the allocated block. Particularly for small allocations, this provides a substantial space savings.
Drawbacks
- Memory pools may need to be tuned for the application which deploys them.
Read more about this topic: Memory Pool
Famous quotes containing the words memory and/or pool:
“A man at work, making something which he feels will exist because he is working at it and wills it, is exercising the energies of his mind and soul as well as of his body. Memory and imagination help him as he works. Not only his own thoughts, but the thoughts of the men of past ages guide his hands; and, as part of the human race, he creates. If we work thus we shall be men, and our days will be happy and eventful.”
—William Morris (18341896)
“Just getting in the pool for seven straight hours is unbearable to me.... Its grueling. Theres nothing physically pleasurable about it. If youre doing a hard workout, youre throwing up in the gutter. At night you cling to your pillow and just hope that your body revives before you have to go back and do it again.”
—Diana Nyad (b. 1949)