Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssetManager.as : making the call to System.gc() in finish() optional/disabled by default #739

Closed
gsynuh opened this issue Jul 18, 2015 · 1 comment

Comments

@gsynuh
Copy link

gsynuh commented Jul 18, 2015

Hi !
Following the topic started by as3gpu and his findings here :

The issue is currently Assetmanager forces garbage collection (on Air apps or flash player debugger) with System.gc() here :
https://github.com/Gamua/Starling-Framework/blob/master/starling/src/starling/utils/AssetManager.as#L743

This should not be a problem where you load assets during a static loading screen as this is a good time to collect garbage anyway, however in a scenario where one uses multiple asset managers, some to load in assets during the app/game, this will force garbage collection during the game/app and potentially cause an undesirable fps drop.

the suggestion is to make this System.gc() call or even System.pauseForGCIfCollectionImminent(0); optional and in my opinion even disabled by default in the Assetmanager class directly provided with Starling - to avoid having to extend it just for that.

@PrimaryFeather
Copy link
Contributor

Agreed! That code made sense for loading screens, but the AssetManager should be usable at any time within the game. I removed the GC code completely — it's better if the developer decides where to put this code in a case-by-case basis.

I moved the GC-code to the "onComplete" callbacks of the samples, to simply show how it's done as a best practice.

Thanks for creating the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants