New option(.memoryTarget) in CIContextOption

What is the purpose of the new .memoryTarget option in CIContextOption added in iOS 17? And it is interesting that this option is added only in swift interface.

https://developer.apple.com/documentation/coreimage/cicontextoption/4172811-memorytarget

Add a Comment

Accepted Reply

From the comment in the header file:

A NSNumber that specifies the maximum memory footprint (in megabytes) that the CIContext allocates for render tasks. Larger values could increase memory footprint while smaller values could reduce performance.

It basically sets how much memory Core Image is allowed to use (roughly) during rendering. From what I observed, the default seems to be 256 MB.

Replies

From the comment in the header file:

A NSNumber that specifies the maximum memory footprint (in megabytes) that the CIContext allocates for render tasks. Larger values could increase memory footprint while smaller values could reduce performance.

It basically sets how much memory Core Image is allowed to use (roughly) during rendering. From what I observed, the default seems to be 256 MB.