Sie sind nicht angemeldet.

1

Dienstag, 17. Oktober 2017, 08:12

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 ?

2

Mittwoch, 18. Oktober 2017, 11:42

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

3

Donnerstag, 19. Oktober 2017, 13:54

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 ((

4

Donnerstag, 19. Oktober 2017, 16:11

Hi,

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

This is your embedding code:

Quellcode

1
2
3
4
5
6
7
8
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:

Quellcode

1
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

5

Freitag, 20. Oktober 2017, 07:26

Hi, thank you very much.