UPBGE freezes on macOS, any reasons why?

I regularly use UPBGE, and the one thing that grinds my gears on macOS are the freezes that UPBGE does. This usually occurs while working with shader node trees, in which there is usually a slight delay as UPBGE must update the scene and compile shaders (visible through a progress bar on the app icon), however sometimes it just freezes midway through this process. Sometimes, moving or rotating the 3D viewport also causes a freeze, but less often. I suspect that when the app runs out of RAM, it freezes, which is the problem here.

While there is no fix to an app that runs out of RAM (aside from optimising), I also want to ask if anyone else experiences freezes like these? I know there is now Metal support in 0.36 which should help a bit.

I also somehow get this message in the console that says something like contextmsg: msgtracer returned -1 or something like that which has a chance to freeze UPBGE.

Converting whitespaces to tabs/spaces can also cause a freeze, though this has existed since 2.79b. If I try to write a single character in the Text editor without first clicking in the editor, it may also freeze or crash UPBGE, though this has also existed since 2.79b.

I wonder why UPBGE uses up RAM so fast, particularly when trying to update materials with refractions? I get reflections and refractions are expensive, but they shouldn’t be enough to freeze UPBGE completely.