Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: WebGL: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one

I have a JavaScript using the THREE.js package, I made some changes, saw the error, and undid all of the changes I have made.

However, the following error remained:

Error: WebGL: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one.

A google-search did not reveal something useful (16 hits!).

Anyone has any idea what is going on? Maybe this error has nothing to do with my script, but with the browser itself?

like image 810
Alex Avatar asked Nov 19 '15 10:11

Alex


3 Answers

In my case, the solution was as simple as closing the browser window, opening a new one and reloading your project. The error appears only after I've reloaded my project in the same window more than 16 times.

like image 91
shopofolive Avatar answered Nov 05 '22 10:11

shopofolive


I'm seeing this error in FireFox (55) it's happened across a number of small test projects I've been working on.

The only solution I've found is to close and reopen FireFox, which leads me to believe that something isn't getting cleared out upon a page refresh. I've also noticed that leaving my browser open over night can result in very poor performance the following day until I reboot my PC. Perhaps either a Threejs issue or a FireFox (55) one when dealing with WebGL.

I'm going to continue investigating it as I work.

like image 38
roskelld Avatar answered Nov 05 '22 11:11

roskelld


There is a fixed number of WebGL context instances available in Chromium, 16: https://code.google.com/p/chromium/issues/detail?id=226868

It is possible you've either got 17+ tabs open simultaneously or you have one or context with a combined pixel resolution greater than 16 * 1024 * 1024.

like image 30
Thomas Nadin Avatar answered Nov 05 '22 11:11

Thomas Nadin