Upvoted. This is something I learned rather recently. Sometimes it’s more performant to slowly leak than it would be to free properly. Then take x amount of time to restart every n amount of time.
A middle ground is a memory pool or an object pool where you reuse the memory rather than free it. Instead, you free it all in one operation when that phase of your application is complete. I’ve seen this done for particle systems to reduce overhead.
Upvoted. This is something I learned rather recently. Sometimes it’s more performant to slowly leak than it would be to free properly. Then take x amount of time to restart every n amount of time.
A middle ground is a memory pool or an object pool where you reuse the memory rather than free it. Instead, you free it all in one operation when that phase of your application is complete. I’ve seen this done for particle systems to reduce overhead.