Skip navigation
Currently Being Moderated

Let me get this straight .... adding assets to the library increases RAM usage?!?

Aug 3, 2012 9:52 PM

I am almost done with a rather large RPG containing over 2000 music and bitmap assets.  When I run this app in iOS, Android or on PC, my RAM usage is well above 100MB. I have no timeline code.  The game is broken into about 100 AS3 classes (1 per level).

 

As an experiment, I have deleted all of my code and packaged an "empty" app.  My RAM usage is still over 100MB.  This leads me to believe that my entire libraray is loaded into RAM when my app launches. 

 

Is there a way to control or prevent this?!  Loader class? External SWC of assets?

 
Replies
  • Currently Being Moderated
    Aug 8, 2012 7:55 AM   in reply to distropolis

    Hi ,

     

    You can check these link - http://www.adobe.com/devnet/flash/articles/combine-swfs-with-swcs.html and http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html

     

    Let me know if this helps.

     

    Thanks and regards,

    Sudeshna Sarkar

    Adobe Flash Professional Team

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 16, 2012 4:48 PM   in reply to distropolis

    Whatever you compile into your application is loaded into RAM when application unfolds. There is nothing you can do about it.

     

    SWC will not help. SWC is used, mainly, as an external library at authoring time and all the objects referenced at authoring will be still compiled into application unless you use RSLs and load extra libraries at runtime. By checking "merge into code" you still instruct compiler to include all assets. If you don't merge into code - you will have to write logic that loads libraries at runtime.

     

    The main issues in your case is that you compile media assets into the application. Videos, sounds and, to a lesser extent, images are the biggest memory hogs. You should load them at runtime - not to include them into your application. Especially this concerns sound files - Flash is very good at runtime playback/streaming.

     

    When I say "runtime loading" I don't mean necessarily loading from the network/Internet. Since you are developing mobile apps (I assume using AIR) - you can write these assets into file system at installation and then retrieve them as needed.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 3:45 PM   in reply to distropolis

    It depends on what use cases you need to cover.

     

    You will need to come up with an architecture that will allow for assets loading progression in the conjunction with user experience.

     

    Since, as I understand, this is a mobile app - you are, perhaps,  better off saving all files on the device and use them, as needed, at runtime. You would do it with file manipulation capabilities of AIR. I am not talking about compiling assets into the main application but providing them externally - saving them in some folder on a device that you write at installation or first run. This way your main application will be very small and RAM usage will be tamed at any particular moment.

     

    Since this is a game - loading from external source may not be feasible because network/Internet connectivity is not always available.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points