Krpano 2D object: Does not load all images -> constant CPU usage

  • Hi guys, Klaus,

    I am working on an app that uses krpano object to show a 2D object. We have made several tests and it all worked fine... until now. Now we have to make a more elaborated example to show it to the client and I got stuck. Here is the description:

    The test example was done with 90 images of 1920 x 1080.
    The XML is as follows:


    The example works excellent.

    Now for the client we went for the same but increased the image count to 151:


    The problem is that the client example never and I mean NEVER loads all the images without interaction. The CPU usage is really high all this time. I open the app, the CPU usage shoots to 200%. 15 minutes later it is still 200%. I know the images are not loaded because if I spin the object around, a few images still "flash" black. After I make a full spin, the CPU usage falls to normal, so I assume this has something to do with loading and for some reason it is not loading all the images. Also, events.onloadcomplete is not fired. Is there any explanation to this? What am I missing?

    EDIT: Note that the first xml is missing the '% 0 f' string, the forum cuts it out.
    EDIT2: 143 images work. 144 do not. ??? At least in my case on this machine.

    Edited 2 times, last by Fygo (January 8, 2014 at 6:16 PM).

  • Hi,

    the 'aspreview=true' setting forces the viewer to load ALL images of that level.

    But 90 images with 1920x1080 don't fit into the memory by default.
    The memory need would be ~712 MB (90x1920x1080x4), but the default memory limit is 350 MB.

    See here:
    https://krpano.com/docu/xml/#memory

    So the viewer keeps trying to load all the images and at the same time also trying to free up memory by removing currently not needed images - this leads to endless loading and unloading.

    Either increase the memory limit - e.g. by:

    Code
    <memory maxmem="800" />

    Or use several resolutions (multiresolution) and use the 'aspreview' only on the lower levels. This way the high res tiles will be only loaded on demand.

    Best regards,
    Klaus

  • Surprisingly, those 90 images fit into memory without problem. I assume you don't keep the references to the bitmaps so maybe they get garbage collected right after the load before the other ones load?

    However, increasing the memory limit indeed helps, 151 images now without problems. Thanks Klaus, you always have the answer! *smile*

Participate now!

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