Ionic Push has memory leak on iPad


#1

Hey,
So I’ve been able to get Ionic Push in production mode working on iPhone just fine, but when I attempt to load the same app on my iPad, it halts at Ionic Push: register, CPU goes up to 98%, memory hits in the hundreds, and will eventually kill itself. None of that happens on the phone, and the apps runs normally with Push notifications working.

If I comment out all my push code, the app runs just fine. Also note this is almost immediately off the tabs starter following the Full Setup for push tutorial, so there should not be anything that could conflict with it.

It seems that this only happens in the push.register() call, with it commented out the app runs normally but then you don’t get a device token to save.

Any ideas would be appreciated. Thanks!

Update: Tried running on an iPhone 5c and found that while the memory didn’t go as high, the CPU usage did jump to 97% and was stuck on the main page. This was fixed by commenting out the push.request() lines and then the app ran normally. I then tried using another “blank” app and that one ran fine on the 5c but still cause memory leak on iPad.
Does this mean that it could be a hardware limitation instead of code? (also the iPad is a 12gb iPad 2)

IPad is using iOS 9.3.1
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Version: 1.3.0
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.7.0
ios-sim version: 4.1.1
OS: Mac OS X El Capitan
Node Version: v4.1.0
Xcode version: Xcode 7.3 Build version 7D175


#2

So I worked on this a bit more and I’m finding that it a lot more than just push is causing issues. I’m tempted to remove the plugin as I’m getting depreciated message on the build for a new ios platform, but I did get push to work on an earlier attempt by using a setTimeout on the register function (just under a second) which solved the memory leak the first time.

If anyone else is experiencing iPad memory leaks I’d be interested to hear what caused it and/or what fixes were used.

Thanks!

Update: So it turns out that one of my views is causing the memory leak; the login page. As long as I don’t use that page, my app runs fine on iPad but as soon as I go to it as my starting page, it immediately goes leaks memory with 98% CPU usage. On iPhone this doesn’t happen at all, runs perfectly and memory stays at consistently lower levels. Looking into what could cause it in that setting.