Why oh why does Instruments keep halting my app???


dhoerl
 

Its been a while since I needed to use Instruments to track down a memory leak. But now I'm working for someone whose app has a massive 70M leak on a certain transition. So yeah, like the old adage, "A programmer decides Regular Expressions will solve his problem. Now he has two problems." [Using latest Xcode, latest iOS, Catalina mac latest, etc].

Run my app using Xcode on a real iPad, watch memory in the mini-memory instrument in Xcode. See the memory jump. Relaunch, then "Transfer" the session to Instruments. Works fine. Instruments comes to the forground, all is well, see the list of stuff growing etc - then 30 seconds later, Instruments just stops. It appears my app is now in the background. [I believe I tried to interact with it earlier, it still stopped working.]

This app has a video stream from the camera going - I think maybe its just too much memory churn whatever.

So this morning I take a little demo iOS app I have - all it does is launch, prints something, then sits. I run it from Xcode, do the same thing. Progress! It runs a full 57 seconds before Instruments stops recording! During the last 54 seconds, nothing is happening whatsoever - no memory churn, zip, nada.

I would be just soooooo happy if anyone can shed some light on this. I googled around found nothing. I guess I should look at a recent WWDC video on Instruments to see if that sheds some light. 

David


dhoerl
 

Grrrrr - so after I hit send, I go back to shut the test app down. But wouldn't you know it - Instruments started up again - all by itself?!?!?!? Its now at 13 minutes - now at 16 minutes - and purring like a kitten.

WTF?!?!?!?


Alex Zavatone
 

Don’t use Instruments.  

Use the Memory Graph Debugger and the .memgraph files it can create.

I have also created a memory query method (for iOS) that logs the memory used that matches what the memory graph indicates in the Debug Navigator, which you can use and modify 


I’m happy to help if you’re unfamiliar with it.  It’s a joy.

Instruments files can reach GB in size easily.  .memgraph files are MUCH MUCH more useful if you turn the right options on in your build scheme.

Cheers,
Alex Zavatone


On Apr 15, 2020, at 7:55 AM, dhoerl via groups.io <dhoerl@...> wrote:

Grrrrr - so after I hit send, I go back to shut the test app down. But wouldn't you know it - Instruments started up again - all by itself?!?!?!? Its now at 13 minutes - now at 16 minutes - and purring like a kitten.

WTF?!?!?!?