0

I'm working on running some memory tests on one of my applications, and I was rather surprised when I ran into a huge leak on a view controller I had never seen leaking before. The profiler is not flagging it as a leak, but the memory continues to grow unbound every time I open and close a particular view controller.

It appears that view controller itself is getting released, but the views are sticking around.

Generally I would consider this an issue in my code, but I have run tests of the application in iOS 10.3 and 11.1 and the memory leak does not occur for either of those, and I don't have any code paths that should be executing differently for those iOS versions.

I have spent hours looking through our code, and don't see anything that I believe should cause the leak either. I'm beginning to think that there is a bug in iOS 11.2, or perhaps a bug in the profiler.

So, to get to my question, are there any bugs in iOS 11.2 or in the profiler that anyone is aware of that could cause this issue?

EDIT:

I ran an app on the iPad I was testing on to verify that the memory usage was continuing to grow, and it was growing as the profiler showed. So I'm now fairly confident that this is due to either a bug, or an intentional change in iOS itself.

EDIT 2:

Here is an example of a text field that is sitting in memory when it shouldn't be. I'm not seeing any direct links back to anything of mine that should be holding it in memory. I can run this same thing on 11.1, and the view is correctly cleanup up. memory debugger

Eagle11
  • 661
  • 8
  • 25
  • 1. Use the static analyzer ("Analyze" on "Product" menu) to make sure there aren't any memory issues in your Objective-C code. Make sure you have a clean bill of health there before proceding. 2. Use "Debug Memory Graph" feature or Instruments' "Allocation" tool to identify precisely what is being allocated and not being released. Once you've done both of those, edit your question with the findings. But no one can help you without your having provided information about what precisely is being allocated and not released as well as what debugging you've done. – Rob Jan 22 '18 at 15:53
  • I have done all of those things as part of my standard memory analysis routine. Static analyzer doesn't give me anything useful. I'll get some screenshots from what I can get on the memory graph debugger shortly... The views that are on the view controller appear to be what is leaking. I realize that nobody can help me debug that with the limited info I have provided. I was mostly interested in seeing if anyone else has experienced issues with memory not working the same on iOS 11.2. Since these issues don't happen on other iOS versions. – Eagle11 Jan 22 '18 at 16:53
  • 1
    https://stackoverflow.com/a/48088789/77567 – rob mayoff Jan 22 '18 at 17:49
  • Oh wow. That looks like it might be my issue. – Eagle11 Jan 22 '18 at 18:41

0 Answers0