I'm in the process of refactoring a humongous monolithic app with multiple extensions into a setup where we have a service library which is linked to each of the targets.
However, this causes a significant issue when the service library is being referenced from the notification extension, as that extension has a hard memory limit of 12MB on an iPhone 5s, which we are still supporting, and our memory usage is at about 11MB which is way too close for comfort. When the memory usage surpasses the limit, the notification extension is automatically killed by the system.
Profiling with Instruments/Allocations has shown that a significant chunk of that memory is allocated (wasted, really) by the internal AVSecondScreenController.load()
class initializer from the AVKit library.
My approach is now to try to figure out what causes AVKit to be loaded in the first palce. I have no explicit imports for AVKit in the notification extension and attempts to figure out what triggers it from the service library failed as well.
I did add a symbolic breakpoint for AVSecondScreenController.load()
which is hit, but the backtrace is useless.
Does anyone have any idea how I can pinpoint what causes AVKit to be loaded in the first place?
Thanks!