Memory leak on modal open - IOS 8.1.2


I have strange behavior on modal opening.

Currently I’m using combination ng-repeat and ion-slide-box to present slider with some collections inside.

<ion-modal-view class="modal-rounded" >
 <div class="safari-overflow-wrapper">

<ion-slide-box delegate-handle="item-slider"  active-slide="getCurrentIndex"  on-slide-changed="changeSlide($index)" class="custom-slider">
  <ion-slide ng-model="item" ng-repeat="item in getCurrentMonthEvents() track by">
       <div ng-include onLoad="event=item" src="'js/modules/calendar/calendar-item/pairing-item.html'"></div>

When I burst the ng-repeat with more than 20 elements I get strange behavior on different ipad devices when I open and close modal several times repeatedly:
8.1.0 - Ipad air 2 - App works normal
8.0.2 - I pad mini 1 - Memory warning
8.1.2 I pad air 1 - Memory warning - App crashes on next modal opening- no exception

App doesn’t get over 60MB of memory usage when I look on x-code profiler. Memory seems stable and doesn’t increasing

My intention to refactor template is next:

  1. replace ng-repeat with collection repeat
  2. exclude ng-include and create directive to load template with all items that I’m using

And my question are next:

  1. How stable is combination ion-slide-box and collection repeat (any examples) ?
  2. Any idea how can I get little dots on the top if I combine ion-slide-box and collection repeat
  3. Any other memory optimisation tricks when opening/closing modal ?
  4. Any other rules for modal open close behavior.

Regards, stjepan

I’m see the “memory warning” on modals with slideboxes too. My images are very small and I only have about 8. Just posting here to let you know it’s a “thing”. Don’t have time to look into now, but I need to fix this too.

Thanks for the response Calendee, just to know that I’m not alone in the dark is the big thing… I’ll open the issue on github with profile report when I get the time. If you found the solution before, please post it here.


1 Like

Hello, have you found solution ? This is a strange behavior, I have the same problem with the same iOS version !
Thanks !