PhotonDust - debugging trail memory allocator

Описание к видео PhotonDust - debugging trail memory allocator

This one is a bit more technical demo, but a very important one. Testing the particle trails in Resonite, I noticed the system slowed down significantly and Resonite started bloating memory usage super fast - taking several dozen GB very quickly and continuing to grow.

I was pretty sure that there's an issue with the memory allocator used for particle trails, but it's one of those things that's harder to determine what's going on, so I made this tool to visualize it!

This video is after I've already fixed the issue - I was using wrong index when the allocator is finding a free range of chunks for the particle trail. I've left it running for a bit, with a simple particle simulation that's emitting particle with trails and slowly increasing the number of particles in the simulation over time - you can see it allocate more and more trails and eventually it needs to actually expand the memory it uses.

The allocator is designed to try to reuse same buffer for particle trail point data as much as possible - when particle trails grow in size, they will first try to expand to free chunks following them, if there's no space left, they'll move the trail into new space and free the previous one.

This way all the particle data is kept in a single continuous buffer, with the space re-used.

It's now all working properly! It's kinda mesmerizing to watch it in action.

Support development at:   / resonite  
Official website: https://resonite.com

Комментарии

Информация по комментариям в разработке