Question

while I was improving my app in Instruments, I saw a irregular production of memory or better memory which isn't being removed.

As you can see in the screenshot the memory increases step by step. It's increasing when I push the Controller to the View, which is animating pictures.

Example: I start in the Menu and go to the AnimationView --> memory usage is increasing. I go back but the memory level stays the same. When I push to the AnimationView once again --> memory level is increasing.

How can I get rid of that. I mean normally the memory has to be deleted when I quit the AnimationView

Screenshot Instruments

Best regards from Germany Chris

Was it helpful?

Solution

Memory use that grows and never drops back down is usually a sign that you are creating things and never discarding them when you are done.

I would guess that you are using storyboards, and simply invoking a new segue every time you want to display a new screen, but never popping view controllers/dismissing modals/doing unwind segues.

When you invoke a segue, iOS creates a new instance of the target view controller. Thus you can end up with an ever-increasing number of view controllers in memory, when what you meant to do was to dismiss a view controller and return to the previous view controller.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top