3 ms·
What's the state of the art in memory allocation?
by senatorobama 9y ago
What's the state of the art in memory allocation?
- krona 9y agoDepends what you mean by state of the art, but jemalloc?
- imtringued 9y agoThe application acknowledges that a general purpose allocator can't be tuned to it's specific needs and therefore implements it's own very restrictive, specialised, simple and fast allocators. The most simple and therefore fastest possible memory allocator usually is just a continguous byte array and an offset. On allocation you check if there is enough memory left and if not you request another very large block of memory from the general purpose allocator. Otherwise you merely return the current offset and increment the offset by the size of the allocation. Of course the restriction here is that you can only delete all allocations at once or none at all. Generational garbage collectors go one step further. They are capable of detecting whether the object is alive or dead and thus make it possible to keep them and move them into an different memory area. Unfortunately the garbage collector has to stop all mutator threads otherwise the mark and sweep phase, copying phase and compation phase would not work. There do exist some concurrent garbage collectors but they are not widely used.
- flamedoge 9y agohttps://stackoverflow.com/questions/9866145/whatre-the-differences-between-tcmalloc-jemalloc-and-memory-pool https://stackoverflow.com/questions/9866145/whatre-the-diffe...