PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 29, 2022

[FIXED] When is the memory allocated for UICollectionViewCell rasterizations freed?

 September 29, 2022     ios, swift, tvos, uicollectionview, uicollectionviewcell     No comments   

Issue

So, in my app I have a bunch of view controllers that use UICollectionView as their main structure. These contain cells composed of an image and some overlay text and there are a potentially large number of these cells that will be created throughout the course of navigating the app (well into the hundreds and possibly 1000+. It's a huge catalog of content). I've found the enabling rasterization:

cell.layer.shouldRasterize = true
cell.layer.rasterizationScale = UIScreen.mainScreen().scale

drastically speeds up performance, making the framerate go from ~31fps to ~58fps, but, as expected, the memory for the app steadily increases.

So my question is when are these cached rasterized images removed? Is it only when the app is stopped? Or is it when the views containing them are deinit? Is there a way to manually force them to be removed if it's the former?


Solution

enter image description hereThe cached layers are removed if unused for 100ms.

Here are important notes from WWDC 2014

  • The image is composited on the GPU
  • Cache size is limited to 2.5x of screen size

http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_advanced_graphics_and_animation_performance.pdf



Answered By - Mark McCorkle
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing