Apple mentions in its Application Extension Programming Guide that memory limits for application extensions are well below the limits set for foreground applications. In addition, some types of extensions may have lower limits than others.
Apple does not know about these memory limitations, as far as I can tell, and it is unclear whether they depend on the device and how much memory other applications consume. But, as Ethan said, for keyboard expansion, you should aim for less than 30 MB to avoid crashes.
It is also important to check the extension if it is not running in Xcode, or using the debug build configuration. It seems that the memory limits for debugging collections are much higher.
source share