Leak memory when using spherical preview images.

  • I have serious problems with memory leak.

    I use krpano 1.19-pr13 (build 2017-09-21)


    After a little research, I realized that this problem is related to spherical preview images.


    What can I do to avoid memory leaks ?

  • Hi,

    sorry, but I'm not able reproduce or find a problem here...
    And I have just checked again, all textures were deleted and all resource references removed when not needed anymore.

    Please post more details or your example.

    Best regards,
    Klaus

  • Hi,

    Attach a link to Video and Source code

    • You need to run my example.
    • To hide the panorama, I use next code "removepano('pano');"
    • I'm looking at the diagram 'Memory usage'
    • I take turns to press the buttons to show and hide. About 10-15 times.
    • The diagram 'Memory usage' shows how the memory grows
    • After reload this page, the memory is cleared.

    Can you tell me why this is happening and how to solve such a problem ?


    A similar problem I see in other browsers and on mobile devices ((

  • Hi,

    thanks for the great video and example, but in your pano removing code is wrong.

    This is your embedding code:

    Code
    embedpano({
        swf:"krpano.swf",
        xml:"krpano.xml",
        target:"pano",
        html5:"auto",
        mobilescale:1.0,
        passQueryParameters:true
    });


    There is no 'id' defined there - so the default id is 'krpanoSWFObject' - see here:
    https://krpano.com/docu/html/#id

    but when removing you call:

    Code
    removepano('pano');


    That means with 'pano' instead of 'krpanoSWFObject' - and so the krpano unloading code never gets called.
    The removepano function needs the id as parameter:
    https://krpano.com/docu/html/#removepano

    When correcting the code, there is a lower increase of memory usage, but there is still one for some reason. I don't know why the memory still increases (could be also a browser related thing), but I will check this to make sure.

    Beside of this - using directly such large images (12000x8484px!) is highly inefficient (as you can see on the memory usage), is problematic on mobile devices and needs longer to load and to decode.

    I would really recommend using the krpano multiresolution system for such large images!

    Best regards,
    Klaus

Participate now!

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