WebGL is not working as well in js api 4.8. WARNING: Too many active WebGL contexts. Oldest context will be lost.

08-27-2018 05:39 AM
New Contributor II


I use js api 4.8 and arcgis server 10.6.1. I use FeatureLayer with enebled WebGL. I have a problem when turn on  many layers , more than 50 . 

and get WARNING: Too many active WebGL contexts. Oldest context will be lost./  

And some layers desappere. Once it happens i get some other errors

So question, is there limit of WebGL context ? Is there any way to fix this issue?

Thank you

0 Kudos
4 Replies
Frequent Contributor

I've seen this too. I think it was 8 or something. It really hammers then bombs Chrome.  I was hoping first vector tiles would be my savior to slowly loading layers in viewers. (with fast servers, lots of memory and coming from fgdb and 10.6.1 etc). However since they don't have popups and full attributes to query, those can't replace map image dynamic layers. I then saw web GL presented this year at dev conf. But I have also run into this issue. Between this, security issues and minimal backward compatibility it would seem these are not a full replacement yet either. I just need my layers to draw faster. Will keep researching.  And perhaps at some point web GL will be the way forward, as hardware continues to modernize and various caveats such as security and performance limits are worked out with web GL. But yes I have seen this issue too. It alone made it a non-starter, as it bombs the browser or at a minimum the tab.

0 Kudos
Esri Regular Contributor

Yeah. The WebGL implementation uses one context per feature layer that can be drawn with WebGL. As you've seen, this does have performance issues. We're currently working on using only a single WebGL context for all layers in the app. This will improve performance and allow you to draw all your layers without the 8 - 16 limitation depending on the browser.

Regular Contributor

Hello.  I am using Experience Builder (ExB) to bring together six Workforce (WF) projects under this one application.  We have a total of 114 assignment types.  Originally, we had one WF project will all 114 assignment types, but decided to organize the assignment types by division within our Public Works Department (six).  While trying different reference basemaps in the Dispatcher and Worker web maps, I noticed the maps were not always loading in the Section Views in ExB in the user side of the app.  Pulling up browser developer tools revealed the "too many active WebGL contexts......" message.  I know nothing about WebGL, but found your thread.  I was hoping someone could shed some light on this issue for me.  Many thanks in advance.

New Contributor II

I am also seeking a resolution to this problem. 

This discussion contains some more information on Web GL context limits.

0 Kudos