2 Replies Latest reply on Jun 16, 2011 4:24 PM by PMarzin

    Memory increase using app-storage....

    PMarzin

      Hi!

       

      I'm working on an application that stores pictures in a directory. I was using ApplicationDirectory, which I discovered is a bad practice.

      To access my pics, I used to use:

      baseDestinationDirPath = "app:/Images". My program uses about 17Mo of memory, runs fast, but will encounter security errors in the future.

       

      If I try to use ApplicationStorageDirectory (I copy files to applicationStorageDirectory):

      baseDestinationDirPath = "app-storage:/Images", memory cranks up to 323Mo !!! and the app runs verrrry slowly.

       

      What's the point???

       

      Please help.

       

      Thank you.

        • 1. Re: Memory increase using app-storage....
          Peter Blazejewicz Level 4

          Hi,

           

          app-storage is AIR dedicated storage directory (exact location depends on OS version) - but it should not be tied to memory share that application takes/request/uses at runtime. Are you able to repeat that behavior? (so, now your images are in app-storage directory, application starts and use them - what is memory share per application?)

           

          regards,

          Peter

          • 2. Re: Memory increase using app-storage....
            PMarzin Level 1

            Hi Peter,

             

            and thanks for answering. I don't exactly understand what you call "memory share". Maybe I didn't explain my problem right. Let's be more precise:

            I've written this app using Air SDK and run it under Vista64. It uses some pics, and user can add some, kind of a gallery to make it simple.

             

            One of my classes accesses thes pics, and performs simple operations (resizing, thumbnail generation, basic treatment,...).

             

            Everything was OK until I decided to use App-storage instead of App directory.(At first, I wasn't aware of the security problems raised by writing ApplicationDirectory).

             

            When I just change one line of code (baseDestinationDirPath = "app:/Images" to baseDestinationDirPath = "app-storage:/Images", the app starts running very slow and memory usage changes from 17Mo to 323Mo! Same problem wether I use a profiler or install and run my app.

            I just tried to run both versions under Ubuntu 11.04: same memory problem (+ I get a security-error when trying to write to app-storage...). Under Linux I can't profile it, but my app is MUCH slower...

             

            I really don't understand why using app-storage instead of app can alter performance so dramatically! I guess it shouldn't... I 'm trying to use different profilers to try to understand the problem, but I'm not experienced enough.

             

            Thanks for your help!