Bug 51541 - Memory Leak in Java on Xamarin.Forms Previewer
Summary: Memory Leak in Java on Xamarin.Forms Previewer
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Xamarin.Forms Previewer ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: --- blocker
Target Milestone: 4.3.0 (C9)
Assignee: Kyle White
URL:
Depends on:
Blocks:
 
Reported: 2017-01-14 23:52 UTC by Tony
Modified: 2017-01-17 19:16 UTC (History)
9 users (show)

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


Attachments
Screenshot (104.42 KB, image/png)
2017-01-14 23:53 UTC, Tony
Details
xamarin log (1.85 KB, application/x-zip-compressed)
2017-01-14 23:55 UTC, Tony
Details
Manage Nuget packages package config error (100.29 KB, image/png)
2017-01-15 00:38 UTC, Tony
Details


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 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:
VERIFIED FIXED

Description Tony 2017-01-14 23:52:09 UTC
# Steps to reproduce
Updated my Xamarin to Alpha (13/01/2017)
Open Xaml file
then click to show the Forms Previewer

# Expected behavior
Use it normally.

# Actual behavior
The forms previewer Works, then after a few seconds memory is increasing until oparating system freezes.
Java process keeps increasing memory usage, until it goes to 5 Gigabytes of ram, my Windows crashed
My notebook has 8GB or RAM

# Supplemental info (logs, images, videos)
https://s24.postimg.org/412u5bjcl/memoryleak.png

# Test environment (full version information)
			  
Microsoft Visual Studio Community 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Community

Microsoft Visual Studio Tools for Applications 2015   00322-20000-00000-AA446
Microsoft Visual Studio Tools for Applications 2015

Visual Basic 2015   00322-20000-00000-AA446
Microsoft Visual Basic 2015

Visual C# 2015   00322-20000-00000-AA446
Microsoft Visual C# 2015

Visual C++ 2015   00322-20000-00000-AA446
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-20000-00000-AA446
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.16.00109.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015 (RC1 Update 1)   14.1.20203.0
ASP.NET and Web Tools 2015 (RC1 Update 1)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9.1   14.0.20622.0
Azure App Service Tools v2.9.1

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.0.6000.0
Microsoft Azure Data Lake Tools for Visual Studio

Clang with Microsoft CodeGen   14.0.25516
Clang with Microsoft CodeGen

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

DataFactoryProject   1.0
Microsoft Data Factory Package

GorillaPlayerPackage Extension   1.0
GorillaPlayerPackage Visual Studio Extension Detailed Info

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Merq   1.1.3-alpha (74d0861)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Data Factory Node Node   1.0
Azure Data Factory extension for Visual Studio Server Explorer.

Microsoft Azure HDInsight HQL Service   2.0.6000.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.6000.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.8
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.8.31121.1

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.40701.9

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

Syncfusion.VSExtension.Troubleshooter   14.1.0.41
Add-in for Troubleshooting the Syncfusion projects.

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Visual C++ for Cross Platform Mobile Development (Android)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (iOS)

Visual Studio Tools for Apache Cordova   Update 10
Visual Studio Tools for Apache Cordova

Visual Studio Tools for Unity   2.2.0.0
Visual Studio Tools for Unity

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.3.0.550 (ff5ef6d)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.1.0.19 (3d959b6)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.4.0.67 (6a925ff)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Tony 2017-01-14 23:53:21 UTC
Created attachment 19345 [details]
Screenshot

Screen shot at second attempt.
THe first attempt my computer freezed at about 5 GB of RAM on Java Proccess after opener Xamarin Forms Previewer.
Comment 2 Tony 2017-01-14 23:55:28 UTC
Created attachment 19346 [details]
xamarin log
Comment 3 Tony 2017-01-15 00:10:10 UTC
Microsoft Windows [versão 10.0.14393]
(c) 2016 Microsoft Corporation. Todos os direitos reservados.

C:\Users\Tony>java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
Comment 4 Tony 2017-01-15 00:38:26 UTC
Created attachment 19347 [details]
Manage Nuget packages package config error

after the OS crashed
Comment 5 Tony 2017-01-15 00:41:13 UTC
After the OS crashed, I rebooted PC, opened the Visual Studio 2015, Managed Nuget Packages, then an error displayed, and the packages.config file on the PCL Project is filled with 00 bytes
Comment 6 Alan McGovern 2017-01-16 13:31:46 UTC
Can you share a copy of the project which triggers the error? Unfortunately the logs you supplied have no actionable information or errors in them
Comment 7 Tony 2017-01-17 15:55:26 UTC
After opening Forms Previewer, edit the MainPage.xaml, the system freeze after some minutes with Java proccess using more than 5 GB ( I could not make a screen shot because whole system freezes whyle memory comsumption grows up )


Link to the ZIP containing the Solution

https://1drv.ms/u/s!AqqOoI2SyeQfjaVzKXC-TOHamOwAgg
Comment 8 Alan McGovern 2017-01-17 16:27:09 UTC
Re-assigning to QA to see if the latest C9 builds exhibit the same problem. I can't test things currently due to a temporary regression in the build.
Comment 9 Alan McGovern 2017-01-17 16:28:18 UTC
Just for context - the attached project works perfectly in XS on MacOS. Either the bug is fixed or it's an issue solely on Windows.
Comment 10 Tony 2017-01-17 17:04:53 UTC
Hey, I updated Xamarin.Forms Nuget to version 2.3.4.184-pre1 and now Java is 0% CPU, Memory only 440 MB. I can edit the XAML normally, and quiqly he result appears on the Forms Previewer. I think this problem is gone for now!
Comment 11 Alan McGovern 2017-01-17 17:20:49 UTC
Ah perfect. We should ensure our logs contain the version of xamarin.forms. XF itself is super important to the stability/reliability of the previewer.
Comment 12 Gonzalo Martin 2017-01-17 19:16:15 UTC
Reproducible with Xamarin.Forms Nuget version 2.3.3.180. 
Verified in Xamarin.Forms Nuget 2.3.4.184-pre1 working without memory leak in Java.

This bug will be closed. If you have a similar problem, feel free to reopen it. 

Thanks.