Return to Starling Playback Library

Memory leak in GAF

Questions related to Starling playback library should be asked here.

Re: Memory leak in GAF

Postby vadym.mitin » January 19th, 2016, 5:47 am

The problem was with CSF=2. Now it's fixed. Thanks for the demo!

According to your post, for Mobile, I can use file system to restore texture atlases instead ByteArray (file zip), is memory when use file system lower than memory when use ByteArray ??

Yes, when you load GAF from the file system GAF library doesn't save PNG in the memory. So memory usage in this case will be lower.
User avatar
vadym.mitin
 
Posts: 254
Joined: December 4th, 2013, 8:00 am

Re: Memory leak in GAF

Postby Lê Huy Hùng » January 20th, 2016, 6:46 am

Hi, everything on web is OK, but on mobile, if I use file system to restore texture atlases, it has a error "[Fault] exception, information=Error: No GAF animation files found". Can you explain to me about this problem and what must I do to avoid this, thank :D

This is my demo
http://www.mediafire.com/download/6s262 ... Mobile.rar
User avatar
Lê Huy Hùng
 
Posts: 61
Joined: July 3rd, 2015, 8:32 pm

Re: Memory leak in GAF

Postby vadym.mitin » January 20th, 2016, 7:17 am

Don't use ZIP in mobile application. It's useless. Instead of this keep all GAF sources in folders.

Use path to *.gaf config file:

Code: Select all
var gafAssetFile: File = File.applicationStorageDirectory.resolvePath("assets/animation1/animation1.gaf");
var converter: ZipToGAFAssetConverter = new ZipToGAFAssetConverter();
converter.addEventListener(Event.COMPLETE, this.onConverted);
converter.convert(gafAssetFile);

Or use path to a folder with *.gaf config file/files and *.png texture atlases

Code: Select all
var gafAssetFile: File = File.applicationStorageDirectory.resolvePath("assets/animation1/");
var converter: ZipToGAFAssetConverter = new ZipToGAFAssetConverter();
converter.addEventListener(Event.COMPLETE, this.onConverted);
converter.convert(gafAssetFile);


See the "data" parameter description in API Reference https://gafmedia.com/docs/starling/trun ... vert%28%29
User avatar
vadym.mitin
 
Posts: 254
Joined: December 4th, 2013, 8:00 am

Re: Memory leak in GAF

Postby Lê Huy Hùng » January 20th, 2016, 7:48 am

Thank, i tried and succeeded. However, according me, work flow (load asset) has a bit complex if i want write a game in both web and mobile (one project in both web and mobile). In web, i use zip and in mobile, i want use gaf config file. Do you any advice for me, thank again :D
User avatar
Lê Huy Hùng
 
Posts: 61
Joined: July 3rd, 2015, 8:32 pm

Re: Memory leak in GAF

Postby vadym.mitin » January 20th, 2016, 8:12 am

I'm not sure that this is exactly that you want but maybe this help you:
http://www.flashdevelop.org/wikidocs/in ... ompilation
http://help.adobe.com/en_US/flex/using/ ... -7abd.html

Using AS3 Conditional Compilation you can write separate logic for WEB and for AIR/Mobile. Hope this is exactly what you need.
User avatar
vadym.mitin
 
Posts: 254
Joined: December 4th, 2013, 8:00 am

Re: Memory leak in GAF

Postby Lê Huy Hùng » January 21st, 2016, 6:56 am

Hi, i completed load asset on both Web and Mobile. On Web, i load zip as normally, on Mobile, I check version asset, if asset is new and need load, i load zip and save it on Local Storage, then pass File to GAF, if asset exist, simply i pass File to GAF directly. Finnaly, it work :D
User avatar
Lê Huy Hùng
 
Posts: 61
Joined: July 3rd, 2015, 8:32 pm

Return to Starling Playback Library

Who is online

Users browsing this forum: No registered users and 1 guest