Memory Error on Studio

Project here: https://www.robotmesh.com/studio/5f5eb63cbdebde75367e0619
I have attempted to run this several times on two different computers. I have cleared my cache and actually purchased an SSD (while I am unsure of if that can have any impact, I needed one anyway) and it still will not run without crashing and throwing a memory error on Chrome
Any idea how to fix this?
Edit:
What happens is it will slowly continue eating up memory while being frozen in the simulation (I can look a round but there are no physics). Despite the fact I have 24 GB of RAM, it still ends up going to 100% and crashing with a SBOX memory error

1 Like

Yikes, that’s quite the runaway allocation. I see similar results on my dev machine.

Adding a millisecond sleep to the main loop seems to fix it: https://www.robotmesh.com/studio/5f6a3790895e3f369ec4214a

I am not sure why this project blows up quite so quickly. We are investigating.

2 Likes

While that did make it so the program can run (which is an overstatement), it will only get around 0.5 frames per second if not frozen for a couple of seconds.

Try this: https://www.robotmesh.com/studio/5f6a3790895e3f369ec4214a?perf

I deleted some intersecting parts, and added the ?perf flag. Running the project with that flag enables the performance graphs, which appear in the bottom right corner.

image

Top is graphics frames (maxing out at the refresh rate of your display) and bottom is physics engine fps.

What numbers do you see on this version of the project?

1 Like

I am seeing 60 on top and like 180 on the bottom when not moving using the code. When moving using the code its around 18 and 40. Thank you so much for your help! In the future to avoid this I should have fewer parts intersect?

Yes. Intersecting or overlapping parts will make the physics engine go nuts trying to push them apart and it will eat all your CPU time. This frequently happens at world origin, 0,0,0 since that’s where parts appear when they spawn.