we are developing an app with Xamarin.iOS, which is rendering real time data. So more or less every second a new location is received from CLLocationManager() and then a map is rendered on the screen with complex and changing information using CoreGraphics and UIKit.
There is a memory leak, meaning depending on complexity of the rendering, the app is giving MemoryWarning after some time, usually 10-100 minutes, and then it crashes. We can't use Xamarin.Profiler because we can't effort VS Enterprise and we don't understand Xcode Instruments, which is in Xcode 13 even more unclear.
So what we are doing, we are systematically skipping code-blocks, run app on real device simulating locations and wait, until MemoryWarnings are starting.
This somehow works, its just very time consuming.
My question is now:
Is there a way to monitor memory consumption/growth in iOS? To see it raising with each loop? Something like:
Console.WriteLine("Current mem: " + GetCurrentIosMemoryConsumtion());
I would like to see the value, which is internally growing and then triggering the ReceiveMemoryWarning event.
Edit: I tried again Instruments, but its freezing the app after 2 minutes. By that time there was 7GiB allocated and freed up again. Only 124MiB persistent so far.