4

I'm developing a little desktop app using Adobe Air and their HTML API. The app has two window, one displaying a slideshow of images present in a folder on the local machine and the other window allows you to browse those images (one big image and prev/next buttons).

At first for a quick test I just loaded all images from the folder into the DOM of each window and it works just fine until I reach too many images (150+) as they are high resolution JPEGs from a DSLR. Obviously each image is taking a lot of memory and will probably kill the app from overleaking. So I started with optimising the browsing window, instead of loading them all I use just a single tag and replace the .src value with javascript. But this technique is just delaying issues because as I carry on browsing all images the memory usage is growing and growing. Replacing the src of the image does not release the memory used by the previous image. Same thing if I try to delete the image from the DOM and recreate it.

An idea I have but I don't like it too much is to display the image inside a frame loading another HTML file passing it the image src as parameter. Then reload the whole frame, hopefully it can reset the memory usage. Haven't tried yet.

Anyone has an idea of how to handle this?

1
  • This is probably caused by a bug in WebKit which Adobe AIR uses to display HTML pages. See bug 23372 and bug 31253.
    – nwellnhof
    Feb 9, 2013 at 14:49

1 Answer 1

0

This is a nice tool for optimizing your Adobe Air application. Adobe Air Tuner:

I'm not familiar with your project; or how it is being implemented. The Adobe AIR has several methods that are accessible to free memory. Which will allow you correctly remove or dispose of your objects. Those cleanups can be found here.

One thing that some people do when creating media players; especially ones with large media. Example:

Lets say your media player contains six pages of content; totaling 1GB of total data. That is a very, very large memory allocation for your project. So rather then call the entire 1GB at once; the first page loads and the second page loads.

The other four pages remain 'uncalled' not dynamically loading. Then the user switches to page two; page three the content begins preloading. The user switches to page three; page four will start to load. But it also disposes of the array or objects created in page one. This way it doesn't affect the application.

Obviously this way is tedious, as your controlling all aspects of the loading. Also it poses issues if your user starts moving to quickly through the pages.

So another possible solution; would be to create thumbnails so the size is drastically smaller. Then load full size images as stand alone streams that can be disposed of without any issues once they leave that area. That way the gallery is stand alone from that.

If you provide some code or some additional details I can possibly assist you above and beyond just interface / memory suggestions of implementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.