Bug 60223 - Xamarin.iOS empty project with memory leak
Summary: Xamarin.iOS empty project with memory leak
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 11.4 (d15-5)
Hardware: Other Other
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2017-10-17 01:50 UTC by huangboru
Modified: 2017-11-22 05:55 UTC (History)
3 users (show)

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

empty projects with memory leak (179.88 KB, image/png)
2017-10-17 01:50 UTC, huangboru
project for leak (12.20 KB, application/zip)
2017-11-22 00:50 UTC, huangboru

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:

Description huangboru 2017-10-17 01:50:10 UTC
Created attachment 25326 [details]
empty projects with memory leak

I create an empty single View app with Xamarin.iOS by VS for Mac.Start it and found 6 leak;
Comment 1 Manuel de la Peña [MSFT] 2017-10-19 15:06:27 UTC

Can you please provide the full environment information and a test application to reproduce the issue. 

Easiest way to get exact version information:
- On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button.
- On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item.
Then copy/paste the version information (you can use the "Copy Information" button).

With that information we will be able to reproduce the issue an asses it accordingly.
Comment 2 huangboru 2017-10-20 02:22:21 UTC
Here is the environment information:
Visual Studio Community 2017 for Mac (Preview)
Version 7.3 Preview (7.3 build 692)
Installation UUID: 4e60959a-758f-48ce-ae6d-26e15276ea83
	Mono (2017-06/fbc487ff424) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504000212


.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Versions:
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin/Sdks

Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools
Xcode 9.0 (13247)
Build 9A235

Version: (Visual Studio Community)
Hash: 697f665b
Branch: d15-5
Build date: 2017-10-09 19:11:38-0400

Version: (Visual Studio Community)

Version: (Visual Studio Community)
Android SDK: Not found

Xamarin Inspector
Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

Build Information
Release ID: 703000692
Git revision: 95452ca0ca037e437019e8d298e684d0d67b993c
Build date: 2017-10-10 13:56:48-04
Xamarin addins: e2b376dbfb700a9627ae07ea84dcf80ad696d7f1
Build lane: monodevelop-lion-d15-5

Operating System
Mac OS X 10.13.0
Darwin 17.0.0 Darwin Kernel Version 17.0.0
    Thu Aug 24 21:48:19 PDT 2017
    root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64

Enabled user installed addins
Internet of Things (IoT) development (Preview) 7.1
Comment 3 huangboru 2017-10-20 02:33:41 UTC
Here is the URL link for the empty project with memory leak : http://pan.baidu.com/s/1i5OSASd
Comment 4 Alex Soto [MSFT] 2017-11-21 23:33:18 UTC
I was unable to download the project from the provided link, could you please give us more context on how you found these memory leaks? and if possible provide again a sample.

Comment 5 huangboru 2017-11-22 00:50:26 UTC
Created attachment 25784 [details]
project for leak

here is the project ,and my iPhone is SE, both has this problem on iOS10.3~11.1.2.
Comment 6 Alex Soto [MSFT] 2017-11-22 02:41:33 UTC
Can you tell me how you found the leak? Xamarin Profiler? Instruments? What instrument did you use? A little more of context would be super appreciated
Comment 7 Alex Soto [MSFT] 2017-11-22 05:55:21 UTC
Sorry I missed your first screenshot, this is kind of expected and documented here[1]:

"Xcode Instruments is a tool that can be used to profile Xamarin.iOS apps on a device or in the simulator. Mono uses its Just-in-Time model to compile code and Instruments doesn’t interpret this kind of data well..."

I would recommend using Xamarin's Profiler[2] instead.

[1]: https://developer.xamarin.com/guides/ios/deployment,_testing,_and_metrics/using_instruments_to_detect_native_leaks_using_markheap/#Overview

[2]: https://www.xamarin.com/profiler