Bright Lee
Bright Lee

Reputation: 2326

Thread finished count does not match started count. (Xamarin.Forms)

I'm making app with using XF pcl. on iOS, Thread finished count does not match started count.

I said this because there is a log output and it prints like "Thread started: #55" and "Thread finished: #55" when I debug with iPhone device.

I counted them but started log counts are about 300 and finished log counts are about 100. Is this can be any clue that my app has some problem that some of started threads were not finished normally?

Or what's the better way to check this issue deeply?

Thanks.

Upvotes: 0

Views: 98

Answers (1)

Timo Salomäki
Timo Salomäki

Reputation: 7189

If you're counting the threads correctly, it really seems that you have a leak somewhere. In your situation, I'd turn into profiling tools and the thread window provided by the IDE. Here are the steps you should take:

  1. Both Xamarin Studio (outdated screenshot) and Visual Studio have a Threads window in the debugger pane that can be used to investigate currently running threads in detail. Use them to verify that you actually have an abnormal amount of active threads.
  2. If you have an Enterprise subscription, use the Xamarin Profiler to find out performance bottlenecks in your application. This will very likely help uncover problems in your code as well as in 3rd party code.
  3. Use Xcode Instruments to do the same as above, if you have access to a MAC. Here's how to use them with Xamarin.iOS.

After these steps, you should have at least verified that there is a problem. It's also quite likely that you've found the cause of that problem and fixed it.

Upvotes: 1

Related Questions