我正在开发一个自定义键盘,其中我可笑地面临内存问题。我进行了各种仪器观察,得出的结论是每次键盘出现和失效时,iOS 都会保留内存。我对这种行为感到非常沮丧,因为就像在 dealloc 中一样,尽管我的项目在 ARC 中,但我已经释放了我所有的 DMA。
场景是这样的:
When I starts my keyboard for the first time it consumes approximately and after some operation it use to increase upto 30 MB and then I invalidate the keyboard. Again when I'm reloading it at that moment it starts from 30 MB which is totally unexpected and due to which after some transitions there is memory pressure and extension gets crashed.
如果有人能提出一些管理内存压力的想法,那将非常有帮助。