3 ms·
I’ll offer that if you have a long lasting thread, you might consider allocating big blocks to it and having a “pool” it can grab memory from. In C++ you can us
by OnlyMortal 3y ago
I’ll offer that if you have a long lasting thread, you might consider allocating big blocks to it and having a “pool” it can grab memory from. In C++ you can use a shared pointer to release it back to the pool.
This avoids contention in user space. It also reduces fragmentation. You can also bound the memory usage by blocking until memory is free.
If memory serves, boost C++ has some code to help there though I did it myself.