2

This is a follow up question to this one: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one.

In that question, it was found that this error happens when you refresh a webGL tab more than 16 times (or collect 16+ contexts across multiple tabs).

However it is not clear how to dispose a WebGL context so that the browser can free up one of the 16 slots for another WebGL context to be able to go there?

Tomáš Hübelbauer
  • 9,179
  • 14
  • 63
  • 125
  • Also related to https://stackoverflow.com/questions/23598471/how-do-i-clean-up-and-unload-a-webgl-canvas-context-from-gpu-after-use – Yves M. Jun 27 '22 at 13:14

1 Answers1

1

If that's still happening it's a browser bug and you should file a bug. Refreshing a webpage should free all resources. There is no official way to dispose of a WebGL context just like there's no official way to dispose an Image or a <video> or pretty much anything else in JavaScript.

See: How to free and garbage collect a WebGL context?

Note the WebGL Conformance Tests create thousands of contexts

https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html

On top of all the contexts created in the 1000s of tests there's a few tests specifically about lots of contexts including this one, this one, this one, and this one

So whatever issue you're seeing you probably need to post a repo.

gman
  • 100,619
  • 31
  • 269
  • 393