You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can ASDisplayNode "unload" its lazy properties under memory pressure?
Some things are lazily initialized in ASDisplayNode. Can these things be nil-ed out under memory pressure? I see a -clearContents method. Is it possible to call something like that on "all the not really visible nodes" when there is memory pressure?
Good question, and yes we do that. When there is a memory warning, all the range controllers in the app shrink their display ranges down to the visible area (rangeMode.) When a node exits the display range, its clearContents is called. Additionally, there is the concept of “visibility depth” for view controllers, which shrinks the display range of view controllers based on how far away they are from visible (say, in a navigation controller.)
clearContents refers specifically to “CALayer.contents,” not to arbitrary preloaded data which should be cleared when a node exits the preload range.
One interesting option, though, is to change the driving event for range controllers from UIApplication memory warnings, to the different warning levels of DISPATCH_SOURCETYPE_MEMORY_WARNING to go even further at the critical level.
BTW I’ve heard about your past work on iPhone, glad to have you working on memory consumption, happy to be a sounding board for any ideas that arise.
These will all help. With Pinterest interested in memory reduction, getting a design in Texture that does not have unbounded memory accumulation as a side effect will be terrific.
Can ASDisplayNode "unload" its lazy properties under memory pressure?
Some things are lazily initialized in
ASDisplayNode
. Can these things be nil-ed out under memory pressure? I see a-clearContents
method. Is it possible to call something like that on "all the not really visible nodes" when there is memory pressure?@nguyenhuy @garrettmoon @appleguy @Adlai-Holler @maicki
The text was updated successfully, but these errors were encountered: