Violation requestAnimationFrame handeler took 'xx' ms

I have been getting an issue with receiving several of the above ‘Violation’ messages causing my website to eventually freeze and for the whole browser to close as if all resources are being maxed out after approx. 5000 ‘violation’ messages. At the outset I was using large glb files and expected to have to remodel the scene in blender and bring down the vertex counts. I’ve just finished the re-topology and I’m still getting the ‘violation’, but not as frequent but it still causes the same issue. If I import the model with plain BSDF materials I can limit the violations to approx. 14-20 during loading but this is all. I’ve brought the file size down from 0.5GB (revit object) to under 1MB (belnder compresed glb ) and still get the issue. I suspect it may be something to do with my image textures. But these are 512x512 and there is only 3no. If I load the assets into a third party viewer such as three.js editor these ‘violation’ messages do not happen (at all!). I use DRACOdecoder (but am unable as yet to implement the preloader). Any ideas what could be causing this issue. The main functionality of the app is to display a model of a building and allow the user to view cross sections, and to toggle the visibility of various elements to demonstrate a potential demolition sequence. So walls and floors are represented as a number of panels and beams are cut into several single storey lengths. There is over 300 individual meshes, but it loads fast and responds to orbit controls with no issue. I’m not getting any errors. The only issue is that a large amount of ‘violation messages’ appears to be using up resources and if left open for a significant time it will freeze and eventually crash the browser.

Hard to tell without code, but it seems like you’re loading models in the render-loop. Don’t use requestAnimationFrame-loops while loading your assets.

1 Like