Hadi Al Tinawi
Hadi Al Tinawi

Reputation: 429

Xamarin.IOS app keep starting and finishing many threads

I noticed while debugging my xamairn.ios app that there are many "Unknown" threads keep starting and finishing as long as the app is running even if I don't touch the screen or don't do any background tasks. I just clicked start debugging in my visual studio and started counting these threads.

My question: Does anyone know what are these threads?

enter image description here

Upvotes: 1

Views: 738

Answers (1)

JoeTomks
JoeTomks

Reputation: 3276

Firstly it's nothing to be too concerned about, even with no user input the device/simulator would spin up threads to handle things like garbage collection. Some of these will be autorelease pools for handling the release of objects no longer required in memory. Bear in mind that iOS has a fairly robust memory management system in place on their devices.1

If for example you were to run the profiling tool against your application, and focused on just memory usage alone, you'd see things like references to 'heap allocations', 'core data objects', 'Core UI', 'Core Animation' etc.

Even though you're not interacting with it, theres still a whole host of system processes running against the application to maintain performance.

Example of memory profiling2

This is obviously not an exhaustive list, so for a verbose answer you'd likely have to do a lot of digging around for the specifics.


1 Memory management

2 Ref Image - "What every iOS developer should be doing with instruments"

Upvotes: 3

Related Questions