Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix proposal for a crash because of lots of unreleased CG raster data (application is unloaded by jetsam).
When we had say 7-10 (or more) animated images on the same page animating at the same time, in instruments we can see that application memory usage is acceptable ~60mb, but "other processes" can be up to 1gb and growing (related to CG raster data). Looks like this issue is caused by the yy_imageByDecoded (YYCGImageCreateDecodedCopy to be more precise). Since
animatedImageFrameAtIndex:
for a sprite sheet image is the sprite atlas itself, thus whole atlas is copied for every frame of animation (we had 60 frames).yy_isDecodedForDisplay
is always YES for animated images (images.count > 1), so seems reasonable to return YES for a Sprite Sheet Images also.After this fix 10+ sprite images on the screen are animating at the same time on old gen iPod (iOS 7) without any issues.