kikito / bump.lua

A collision detection library for Lua
MIT License
922 stars 86 forks source link

Memory Leak for Objects "Falling to Infinity" #55

Open 1bardesign opened 4 years ago

1bardesign commented 4 years ago

There appears to be infinitely-increasing memory usage for an object falling into infinity, eventually leading to a crash as the luajit memory limit is hit, and lagging things up in the meantime as the gc has a bigger workload.

Expected Cause: I believe this is caused by the broadphase structure accumulating empty buckets as the entity falls forever into the void. It'd be better if the buckets cleaned themselves up when/as they were emptied.

Workaround: Can be worked around by defining world bounds and killing OoB objects.

(discovered around the same time as https://github.com/kikito/bump.lua/issues/47 but only recently reminded to report it by @tesselode )