Allow modifying iOS image cache limits#33554
Closed
danilobuerger wants to merge 1 commit intofacebook:mainfrom
Closed
Allow modifying iOS image cache limits#33554danilobuerger wants to merge 1 commit intofacebook:mainfrom
danilobuerger wants to merge 1 commit intofacebook:mainfrom
Conversation
Base commit: 3693928 |
Base commit: 3693928 |
Contributor
|
Could you rebase this @danilobuerger The CI should be green |
Contributor
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
c4beafb to
b36d4fc
Compare
Contributor
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Collaborator
|
This pull request was successfully merged by @danilobuerger in 61b013e. When will my fix make it into a release? | Upcoming Releases |
Saadnajmi
pushed a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Jan 15, 2023
Summary: Allow modifying iOS image cache limits. Currently the image cache imposes some strict limits: [NSCache.totalCostLimit](https://developer.apple.com/documentation/foundation/nscache/1407672-totalcostlimit?language=objc) of 20MB. Single Image Size Limit of 2MB (bitmap size). This may not be enough for applications that make heavy use of images. With this commit it is possible to fine tune them to the applications need. This can be set for example in the App Delegate with: ```objc RCTSetImageCacheLimits(4*1024*1024, 200*1024*1024); ``` This would increase the single image size limit to 4 MB and the total cost limit to 200 MB. ## Changelog [iOS] [Added] - Allow modifying iOS image cache limits Pull Request resolved: facebook#33554 Test Plan: There is no easy way to test this except adding the above snippet and checking via break points that the new limits are used. Reviewed By: cipolleschi Differential Revision: D35485914 Pulled By: cortinico fbshipit-source-id: 646cf7cab5ea5258d0d0d0bce6383317e27e4445
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Allow modifying iOS image cache limits. Currently the image cache imposes some strict limits:
NSCache.totalCostLimit of 20MB.
Single Image Size Limit of 2MB (bitmap size).
This may not be enough for applications that make heavy use of images. With this commit it is possible to fine tune them to the applications need.
This can be set for example in the App Delegate with:
This would increase the single image size limit to 4 MB and the total cost limit to 200 MB.
Changelog
[iOS] [Added] - Allow modifying iOS image cache limits
Test Plan
There is no easy way to test this except adding the above snippet and checking via break points that the new limits are used.