Thanks, I atleast know where the issue is, and that its base code level so GC wont matter
main reason im not reusing physics spaces are
1: based on a proof of concept someone made with a plane and boxes/ragdoll and learned as i went, could also go with a general laziness
2: first time doing Async, so not super well versed in sending data between threads, i honestly make near 0 use of global variables.
3: Dont need physics objects to interact between the spaces, so i didnt see much reason to put them in the same space, also avoids it spawning physics objects in the middle of other physics objects
4: multicore, if I have ~7 cores free, then the physics spaces can be spreadout between them, doing a non worst case but still bad case physics space it can add ~80 static objects, and this prevented me from needing to do culling
5: jank, wasn’t sure how to do water, part of my placeholder is that it just runs the physics space at a lower speed
6: thread safety wise some things need to be done from the game thread, and some need to be done on the Async physics thread, so I made it self contained, it runs all the game thread things ahead of time, then switches to Async and runs all the physics needed before closing.
So maybe what i need to do is figure out what i can do to a physics space without being on its physics thread, maybe i can have a thread just looping physics updates while other threads do some of the logic of adding/removing physics objects.
And have a few physics spaces for different triggers to spread out the load