Standalone quest application freezes when not using profiler

I'm currently working on a standalone oculus quest app with unity 2021.3.31, and I've been running into some really strange and annoying behavior. When I start my application up, everything seems to be running fine for about half a second, at which point the entire application seems to get bogged down by something, and completely stops rendering/freezes, or at least slows down to the point where it only seems to get a new frame out every minute or so. This happens consistently, and I haven't seen anything in logcat that indicates what might be causing this.

The weird thing is that I am able to get the application running, albeit at a slower framerate, but only while it is connected to the Unity profiler via ADB. When I set the application to auto-connect to the Unity profiler, specifically when running the app standalone, whatever blocker exists in the application seems to be completely bypassed, though the application is definitely still slowed down by the profiler. I've had one or two lucky instances where the app worked just fine without the profiler, but those were again lucky and I haven't been able to reproduce this. As soon as I unplug the USB cable from my computer that's running ADB, the application completely hangs again.

I've tried to build the application multiple times in release mode or without the profiler auto-connection, and it just hangs as usual.

Does anyone have any insight into what might be causing this?

Check available hardware or software that running on the system. Might be something like you installed new anti-virus software and it find it fishy process.

Do you see anything there that might suggest optimizations are needed?
Could be something heavy on a loop by chance. Do you use recursion somewhere?
Show pictures if you can.

I can suggest if anything else fails to start chopping parts out of it and then back until you find what part you include in a scene get it to a slowdown.

Edit: Check if you closed down Unity or you just keep it on days in a row. Might help to try and remove the Cache folder of the project in AppData, first run will be slower after you did this. Sometimes helps.

Bear in mind this behavior only happens when I’m running on standalone Android on the Quest: the application runs fine when I run the player locally on Windows, so I don’t think anything on that side should be a problem.

There are definitely optimizations that I need to do, I agree there, but that doesn’t seem to be causing the freeze problem. When I auto-attach the app to the profiler, it runs and doesn’t freeze, though it’s definitely bogged down by the profiler.

I guess I can try whacking some components to see if any of them may be responsible for this.

I had such problem when introduced heavy objects to my android game. The app seemingly froze with black screen. It happened to need more time to load them, and the ran on low fps. See what’s the limit on the actual devices you’re targeting. It seems that the profiler slow it down even on the machine you’re building, which means it’s heavy even there. Running smoothly there means nothing, if it’s not targeted hardware. Get in touch when you “whack” it.