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

  • Hallo Zusammen,

    ich verwende den krpano HTML5 Viewer in einer AngularJS Anwendnung. Das klappt soweit ganz gut, nur wird in der Console ab und zu die Meldung ausgegeben:

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

    Im FrontEnd scheint aber alles ganz normal zu laufen.

    Ich rufe die Methode "embedpano" in einem view Controller auf, etwa so auf:

    	.controller('MyCtrl', function ($scope) {
    		$scope.$on('ngRepeatFinished', function () {
    			embedpano({xml: "config.xml", target: "panorama", html5: "only", passQueryParameters: true});

    Die Meldung tritt auf, wenn ich den view einige Male hintereinander aufrufe. Scheint mir als würde da was nicht korrekt gelöscht/reinitialisiert.

    Hat jemand von euch eine Idee? WebGL ist noch Neuland für mich ...

    Vielen Dank im Voraus!


  • Hi,

    I have the same problem in a one page web app ( AngularJS ).
    We use embedpano in several "pages" in our web app.

    Removing pano with removepano() at page change seems to not remove event listeners from krpano instance at removing time.
    The problem arises after 10 to 20 embed / remove of panos. The message : WARNING: Too many active WebGL contexts. Oldest context will be lost. appears ( tested in Chrome / Safari OSX ).
    The effect in Safari Iphone / Ipad makes webapp crash.

    In krpano's function removepano() there is no removeEventListener at all. Only Dom elements removal ( seen on debugging with Developper Tools on Chrome )

    With one page web applications, every event listener has to be removed ( resize events, scroll events, custom events, etc) before DOM elements are removed, in order to allow garbage collector to free memory.

    Here are some tips on debugging WebGL contexts : https://www.khronos.org/webgl/wiki/Debugging
    Maybe Kaus could tell us what "id" has the Krpano Webgl context once pano is embeded ? I could go further on debugging. Thanks.

    Do you have any solutions ?

    Thank you !

    Edited once, last by cmel (September 21, 2015 at 2:55 PM).

  • After a few times of removing and embedding krpano. I get the same error message "WARNING: Too many active WebGL contexts. Oldest context will be lost."
    I'm using Angular too. But I don't think it has anything to do with Angular.

    here's some code:

    $scope.$on('$destroy', function() { 

  • Same issue where chromium is complaining about too many webgl contexts

    I am facing the same issue when switching two different panoramas in spite of clearing the previous one before loading the next one.
    I'm using chromium for my app. Every time I change the panorama, I'm removing the previous panorama with removepano('krpanoSWFObject'). I have doubled checked and found that even though remove pano removes the panorama from DOM, it probably isn't clearing event handlers and webgl context

    Typical observations I made about this issue include:
    1. The memory consumption increases gradually every time the panorama is changed
    2. After 8-10 times of changing the panorama, chrome starts showing the warning "Too many active WebGL contexts. Oldest context will be lost"
    3. I've tested with Firefox, Chrome and Chromium to find same results
    4. I tried removing the canvas element from DOM using jquery. But, I still didn't notice any difference in the behavior.

  • I have same issues. When i display multiple krpano in single page, it appeared warning log `WARNING: Too many active WebGL contexts. Oldest context will be lost.` in javascript console. And some krpano can't be shown exactly. Please help me.

  • Hi
    Having exactly the same problem as princebk: ... multiple (8) panos on one page. They are small: only 300-400 in width and 159 height.
    Although they are small and i generated an extra low res pano-version for this kind of animated 'preview', raising the amount of embedded panos from 4 (works) to 8 leads to black boxes for some panos.

    Any help out there?

    EDIT: Solved (with help from Klaus):
    The limit of live WebGL-contextes we cannot control or change. It depends on browserversions and other systemspecific parameters.
    But in my case - displaying only small animated panos as eyecatcher (8 at the same time) it helped
    to control the rendering via HTML5="only+css3d". So no WebGL used for this small panos and it looks fine anyway!
    Thx to Klaus!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!