Bug 9416 - Visual Studio (2010/2012) hangs/freezes and memory allocation jumps up and down
Summary: Visual Studio (2010/2012) hangs/freezes and memory allocation jumps up and down
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 3.0
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 12341 ()
Depends on:
Blocks:
 
Reported: 2013-01-09 08:25 UTC by Erlend
Modified: 2016-12-23 19:50 UTC (History)
18 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 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 FIXED

Description Erlend 2013-01-09 08:25:29 UTC
I am experiencing that Visual Studio (2010/2012) hangs/freezes and memory allocation jumps up and down between 200-1G memory usage. I believe it happens after i've debugged on an Android device.

It might be difficult to create a test project and point out the exact problem, because my project is kind of complex, and the app does not crash. The problem is that visual studio freezes and uses lots of memory AFTER I’ve finished debugging.

I looked in the forums and noticed someone had a similar problem and fixed it by closing the adb.exe session:
http://forums.xamarin.com/discussion/comment/1845/#Comment_1845

This solution works for me as well – however I then need to close and restart visual studio (which is also a solution for fixing the freezup, but a very bad solution..).

Probably irrelevant but possible things to look at: 
 -some of my colleagues had some problems with .net 4.5 and WCF discovery.
 -I've heard of problems with usb 3.0 driver on windows.

Im using mono version: 4.4.54.208556545.msi
Comment 1 fxam 2013-03-08 10:14:10 UTC
Using Mono for Android 4.4.55, this happens to both VS2010 and VS2012 Ultimate. Tried to disable all plugins except MonoDroid, still happens. My machine also has USB 3.0. Running "adb kill-server" instantly make the CPU time of devenv.exe back to normal.
Comment 2 dean.ellis 2013-03-11 06:51:56 UTC
Does this still happen on Xamarin.Android 4.6? I have having a hard time trying to replicate this, I've been debugging applications all weekend and have yet to see this issue.
Comment 3 fxam 2013-03-11 10:39:24 UTC
Will install 4.6 soon and observe.
Comment 4 dean.ellis 2013-03-11 12:50:27 UTC
This looks like it could be an issue with the Android Log Viewer. I am investigating further. Do you make use of the Android Log Viewer ?
Comment 5 Erlend 2013-03-11 12:54:59 UTC
I belive the issue has been resolved now with the newer Xamarin.Android version.
Comment 6 Erlend 2013-03-12 06:07:38 UTC
Still experiencing that visual studio hangs after debugging on device. Resolves after i kill the adb.exe process.
Comment 7 dean.ellis 2013-03-12 07:38:15 UTC
Do you have the Android Log Viewer open at the time of the hang?
Comment 8 Erlend 2013-03-13 08:59:03 UTC
I don't believe the Log viewer was open no.

But it doesn't seem to happend as often now, and when it hang's, it resolves itself after a while and seem to function normally.

Btw. it seem double buffering isn't enbabled for the log window, the flashing when redrawing the screen is quite enoying and makes it very hard to read data - this should probably be added as an issue if not allready.
Comment 9 Erlend 2013-03-13 09:02:53 UTC
Btw. im using a Samsung s3 device, targeting API level 16.
Comment 10 SamUrai 2013-05-10 14:40:04 UTC
I am also experiencing this issue. It is becoming unbearable to test the app on actual devices. 

Some details on my environment:

Visual Studio 2012 (running on Windows 8)
Using Xamarin.Android 4.6.00049
Test device is Verizon htc Thunderbolt.

When in the middle of a debug session, interaction with the IDE is unusable to where Visual Studio is no longer responsive. If I click in the IDE window somewhere, it takes up to 2 minutes to respond (this probably varies depending on the PC configuration). When I do get a cursor in the IDE window, typing or setting breakpoints is extremely sluggish. 

Sometimes, while starting the debug session, the device will reboot itself. I have to kill adb.exe to trigger Visual Studio to stop trying to remove existing app / deploy app on the device when it is rebooting.

After stopping a debug session, Visual Studio is no longer responsive until 30 seconds to 2 minutes has passed (again, time probably varies depending on the PC configuration). At times while working with the code, the IDE is sluggish and is hard to interact with.

As with a few other posters in the corresponding forum thread mentioned by Erlend, I have noticed Visual Studio reaching up to 1G of memory usage during these issues. The current workaround requires the adb.exe process to be killed.
Comment 11 Jeremy Kolb 2013-06-05 07:12:39 UTC
Yes it still happens with 4.6.8.
Comment 12 Pieter-Bas IJdens 2013-06-10 03:59:03 UTC
I am experiencing the exact same issue. I'm using Microsoft Visual Studio Premium 2012 Version 11.0.60315.01 Update 2 with Xamarin.Android 4.6.00049 (0e0e51f9) on Windows 8 64-bit. When debugging on an actual device, the visual studio UI is blocked for long periods of time. Killing the adb server immediately unblocks visual studio.
Comment 15 till 2015-06-23 07:14:03 UTC
Same problem here: After debugging with an Android device, my VS 2013 uses >2,5GB of memory and crashes after a couple of debugging sessions.

Configuration:
Windows 8.1

Microsoft Visual Studio Ultimate 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51650

Xamarin   3.11.590.0 (5160db7)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.1.3.1 (d419c934e6ce2113653ff4c40214e3a5d5a69440)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS   8.10.1.0 (fce006eae308515fc1eaf85fcc0f90699d9c7e8b)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration
Comment 16 Daniel Cazzulino 2016-09-16 13:01:17 UTC
We have completely revamped the device logging under VS2015+, which should completely eliminate this issue.

Please give our latest stable release a try and reopen the issue if you see this happening again.

Thanks!
Comment 17 Joaquin Jares 2016-12-23 19:50:43 UTC
*** Bug 12341 has been marked as a duplicate of this bug. ***