So one thing I’ve been noticing since I started working on this three.js project is that every few minutes, Chrome will suddenly freeze up and become unresponsive for about 10 seconds, after which everything returns to normal.
Normally I would debug a problem like this by hitting the ‘pause’ button in the Chrome debugger, but in this case the debugger is frozen as well. I can only halt the program once the freeze is over, by which point it is too late to see what happened.
Now, I don’t expect anyone to solve my problem, given how little information I am able to give; but my question is (a) has anyone else encountered a problem like this, and (b) any suggestions on how to go about debugging this, as I am currently at a loss.
Without information about your system, it’s hard to provide feedback on this issue but you can check a couple of things:
- Make a performance analysis with Chrome dev tools and check if the freeze is related to the performance of your app. The app might allocate too much memory and the freeze is caused by a huge GC overhead. Although I’ve never seen that this could take a couple of seconds.
- Check for a WebGL context lost. For some reasons (e.g. limited hardware resources), the browser could decide to tell your browser tab to loose context and restore it after a while. This can be detected by add a breakpoint here or by checking the browser console.
- Make sure that no other programs run in the background and allocate a lot of hardware resources. You should consider to monitor the entire system with a respective tool.
Hey, thanks for the reply. Yeah I wasn’t expecting anyone to actually diagnose my issue, which is why I didn’t give specifics for my machine - but right now I am primarily working with a 2015 MacBook Air using the latest OSX.
I’ll try the things you mentioned. Thanks!
@viridia I’ve been having the same issue on android chrome sinse the latest chrome update too, was working fine before updating, please let us know if you find a leak or resolution for this and will do the same!
I think I have encountered this problem as well.
What I know for now:
- These freezes occur only with non-indexed geometry (fast check here - three.js examples).
- These freezes occur only on chrome after a certain version (haven’t found the exact version for now).
- I and some of my co-workers got this issue on different computers and operating systems (Macbook + Monterey 12.1, Dell + Ubuntu). But freezes are experienced by a few. I have not yet found a relationship between the os, software, and hardware, which can lead to such a result.
- Consequences are different. On some machines, it is only freezing, on others loss of the WebGL context results in a “hole” through Chrome in a place where the canvas was.
But in my case, this has no end. Freezes won’t go away. The entire Chrome tab is freezing with a huge delay on an interaction. Profiling and performance monitors don’t show any heavy computations. CPU and GPU loads are minimal.