Bug 27931 - Instruments Allocation tool not working with Xamarin when project get "too big"
Summary: Instruments Allocation tool not working with Xamarin when project get "too big"
Status: RESOLVED DUPLICATE of bug 19379
Alias: None
Product: iOS
Classification: Xamarin
Component: General (show other bugs)
Version: XI 8.8.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-03-11 18:31 UTC by Jon Goldberger [MSFT]
Modified: 2015-03-24 13:39 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 19379

Description Jon Goldberger [MSFT] 2015-03-11 18:31:37 UTC
## Description

When a Xamarin iOS app gets to a certain size (as yet undetermined), Instruments occasionally fails to fully launch the app. Instead the app seems to stay in a partially launched state, but never displaying the UI, just a black screen. It seems this issue happens more and more the bigger the app gets. In the included test project, you may have to hit the "Record" button in Instruments several times before the issue is displayed. The customer who reported this issue noted that they could not get the same issue to occur with a fully native app built in Xcode. 

## Steps to reproduce:

1) Deploy the App to the Simulator (device also do the same thing) (Link to get app is in private comment below)
- Start "MyAppHangPOC" under iPad 2 / iOS 8.1 Simulator using Xamarin Studio on a Mac (Debug | iPhoneSimulator)
2) Prepare profiling for the application
- Start Apple Instruments
- Choose Standard > Allocations
- Choose iPad 2 (8.1 Simulator) > Installed Apps > MyAppHangPOC
3) Start profiling the application
- Click the Record button
- See the application restarting in the iOS simulator
- If you see some yellow buttons on a brown background, you didn't reproduce the issue (takes around 3-6 tries to reproduce in PoC)
- Back in Instruments, restart the recording:
- Click Stop
- Wait 1 second
- Restart "3) Start profiling the application"
- If you DON'T see yellow buttons AND Memory Allocation in instruments stop capturing new allocations, you reproduced the issue
- Note: If you see the home screen, tap on the MyAppHangPOC to resume the app

Expected result: App will be fully launched and profiling can occur.

Actual result: The application froze, so instruments can't profile our Xamarin application.

In the simulator logs, you will see this appear after some seconds:
backboardd[6448]: CoreAnimation: timed out fence a397
If you hit the home button while frozen, you should see those logs appearing:
SpringBoard[6447]: LICreateIconForImage passed NULL CGImageRef image
backboardd[6448]: CoreAnimation: timed out fence 4fdb
backboardd[6448]: CoreAnimation: timed out fence a01b
backboardd[6448]: CoreAnimation: updates deferred for too long

## Notes:
* Notes : - It's one of the way to reproduce the issue, not the only one.
- The issue occurs on Simulator AND device
- It occurs with different versions of Xamarin (tested 5.7.1 build 17 and 5.7.2 build 7)
- The more we clean the project, the lower the repro rate is, and it seems to be independant of what we clean
- It occurs on all mac we tried
- It happens on iOS 7 + 8
- Could not reproduce it with pure XCode project
- We tried to delay some code after the MainViewController is displayed, but it still hang later on
- Sometimes (but rarely) it froze even before finishing the WillFinishLaunching in our real application
- Can be reproduced with Xamarin Studio or Visual Studio
- Turning off debugging + Performance Profiling while enabling LLVM does help in PoC (because the app is smaller?), but is not sufficiant for real app.
Comment 4 Jon Goldberger [MSFT] 2015-03-11 18:57:11 UTC
This might be a dupe of https://bugzilla.xamarin.com/show_bug.cgi?id=19379
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-03-24 13:39:59 UTC

*** This bug has been marked as a duplicate of bug 19379 ***