简体   繁体   中英

Degrafa States Memory Management

I was recently profiling my application that uses Degrafa States in the skins and noticed that doing so uses more memory than I expected. Between the SetProperty and State, they were using about 10% of the total used application memory.

Would it be better to use css for the state changes and a new skin for each state?

or

Are there some simple tips to reducing the memory footprint of degrafa?

States in Degrafa skins aren't exactly like they are for UIComponents. For starters they're selected by the "name" property, rather than "currentState". Besides that, it's out of your control, the UIComponent that you're skinning will always create a new skin instance for each state, unless you've set xxxSkin:ClassReference(null); in your CSS. Degrafa States just allow you to write a more readable and maintainable skin class that can be instantiated for each "state" of the skinned UIComponent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM