145

I just finished the installation and the whole IDE is super slow. It seems like it's making some kind of heavy CPU calls in the background where the whole IDE literally freezes and becomes unresponsive for about 2-3 seconds.

I was not having this issue with Visual Studio 2013 Ultimate. I am running Visual Studio 2015 Professional.

Installed Add-Ons/Packages:

  • Node.js Tools
  • ReSharper

Anyone have any ideas?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Spets
  • 2,391
  • 4
  • 24
  • 26
  • Are you using Resharper or Node tools for VS? – Ajay Kumar Jul 22 '15 at 03:55
  • I installed both when I chose the custom installation @AjayKumar – Spets Jul 22 '15 at 03:56
  • I had the same issue with VS2015 RC. It had memory leaks when using NVTS with Resharper. try suspending resharper – Ajay Kumar Jul 22 '15 at 03:57
  • Remove/disable the plugins and see if it improves... Normally it is a plugin issue. – epascarello Jul 22 '15 at 03:58
  • oh man but I love reshaper :( My productivity without it is going to plummet haha. Let me give that a try. I don't really use node.js inside of VS so I hope that's the culprit and not Resharper ^_^ – Spets Jul 22 '15 at 03:59
  • 2
    Uninstalling NVTS....That might work for you. @Spets – Ajay Kumar Jul 22 '15 at 04:01
  • 1
    Removing NVTS did the trick. You should post that up as an answer @AjayKumar ! I did have to uninstall it via add/remove programs. Couldn't uninstall from the "Extensions and Updates" menu in VS Tools – Spets Jul 22 '15 at 04:18
  • My Visual Studio 2015 Community Edition also starts extremely slow. How do I check if NVTS or Reshaper is installed ? I checked in VS menu "Tools/Extensions and Updates" and in Windows "Control Panel\Programs\Programs and Features\Uninstall". – Peter Huber Aug 15 '15 at 07:30
  • what is NVTS? mine is also slow, and leaks memory, but I don't have resharper installed – Maslow Sep 23 '15 at 16:06
  • @Maslow Actually it looks like a typo that kept getting persisted but NVTS should actually be NTVS = Node Tools for Visual Studio. – Spets Sep 23 '15 at 22:29
  • 1
    Disabling _references.js was the culprit for my team. We exhausted all other suggestions but this one ultimately worked. – Dan Waterbly Oct 06 '15 at 14:24
  • There appears to be some kind of an indexing or rebuilding activity that freezes up the main window for up to 3 minutes, and another similar activity that freezes up the new project wizard on my machine for up to 2 minutes. I've decided NOT to interrupt Visual Studio when it has a spell where Sometimes It Just Sits And Thinks. If anybody from Microsoft is reading this could you tell people NOT to freeze up thread zero like this anymore, it stinks. I have no non-microsoft add-ons or tools (resharper etc) installed. – Warren P Jan 07 '16 at 14:35
  • I no longer have these freezes since VS 2015 update 1. Thanks to whoever fixed VS 2015's freezes! – Warren P Jun 06 '16 at 16:01
  • Could you please have a look at [Visual Studio 2015 extremely slow](https://stackoverflow.com/questions/34395686/visual-studio-2015-is-extremely-slow/34450140#34450140). Hope this helps... – Murat Yıldız Jun 15 '17 at 09:38

19 Answers19

89

I found that the Windows Defender Antimalware is causing huge delays. Go to Update & Security -> Settings -> Windows Defender. Open the Defender and in the Settings selection, choose Exclusions and add the "devenv.exe' process. It worked for me

  • 1
    Thanks, this fixed my issue too. i didnt want to uninstall node.js nor resharper so this helped a lot. – Alex Moreno Jun 28 '16 at 03:02
  • 1
    Is simply turning off Windows Defender completely the same thing? – Matt Kocaj Aug 26 '16 at 00:50
  • 5
    @cottsak Would not be recommended –  Aug 26 '16 at 10:17
  • 1
    Thank you so much! My version of VS is speeding up by more than 10s after I did this. – James Ko Nov 06 '16 at 16:06
  • I ran task manager. I saw that when VS was starting the Antimalware executable used far more CPU than VS did. About 20x as much. Adding the exclusion restored my sanity. – RichardHowells Nov 11 '16 at 08:25
  • 6
    Further research found VS's 'slave' processes that also triggered anti-malware activity. For those too lazy (like me) to type them all into the ui (as described by @Nostradamus), start a PowerShell prompt (I used elevated) and paste this in: Set-MpPreference -ExclusionProcess devenv.exe, TE.ProcessHost.Managed.exe, csc.exe, iisexpress.exe, msbuild.exe, vshost32-clr2.exe, vshost-clr2.exe, vshost32.exe, VBCSCompiler.exe, w3wp.exe use *completely* at your own risk. Further information here https://technet.microsoft.com/en-us/library/dn433291(v=wps.630).aspx – RichardHowells Jan 07 '17 at 20:28
  • Reduced a small project build from 0m38s (no exclusions) to 0m06s (exclusions I listed above) – RichardHowells Jan 07 '17 at 20:55
  • Exclude devenv.exe process and for good measure excluded folder `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE` – toddmo Apr 19 '17 at 15:07
  • Not *too* comfortable excluding everything possibly related to the problem from Defender, but wow what a difference! :-o I can actually work again :) Note: I didn't notice any difference straight away, but after restarting VS, it was super snappy! – Christian Rygg May 04 '17 at 19:36
36

My Visual Studio 2015 RTM was also very slow using ReSharper 9.1.2, but it has worked fine since I upgraded to 9.1.3 (see ReSharper 9.1.3 to the Rescue). Perhaps a cue.

One more cue. A ReSharper 9.2 version was made available to:

refines integration with Visual Studio 2015 RTM, addressing issues discovered in versions 9.1.2 and 9.1.3

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
MuiBienCarlota
  • 2,355
  • 1
  • 28
  • 32
23

Try turning off the ReSharper Code Inspection from menu OptionsCode InspectionSetting and choosing Visual Studio IntelliSense (menu OptionIntellisenseGeneral) instead of ReSharper IntelliSense will make it much faster.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
AKaral
  • 237
  • 1
  • 4
18

Try uninstalling either Node.js Tools for Visual Studio (NTVS) or the commercial add-on called ReSharper from JetBrains. Using both NTVS and Resharper causes memory leaks in Visual Studio 2015.

NTVS = Node Tools for Visual Studio

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ajay Kumar
  • 1,154
  • 2
  • 10
  • 24
16

I have experienced very slow edits with Visual Studio 2015 Community Edition especially while working with HTML (and Razor as well) and JavaScript. I was able to resolve the issue by removing the references in the "Scripts/_references.js" file of my ASP.NET MVC project. Furthermore, I disabled autosyncing in that file by adding this to the top of the _references.js file.

This solution causes Visual Studio's IntelliSense to not load show all the JavaScript references available. However, ReSharper's IntelliSense will work perfectly fine and fast.

/// <autosync enabled="false" />
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Dan Waterbly
  • 850
  • 7
  • 15
  • 4
    This file is meant to be for only javascript files that you want to be used by intellisense in ALL javascript / razor files so should only include stuff like jquery, modernizr, etc. In our project it had been autopopulated with every js file in the whole project, which was over 800! Intellisense was struggling so much, the editor couldn't keep up with typing. I've stripped it back to 8 files and now everything's so much better. If you want to reference js in only one or 2 files you can do it only in those files. See http://madskristensen.net/post/the-story-behind-_referencesjs – Mog0 Mar 09 '16 at 11:17
  • @Mog0 Yes, you could do that, but unfortunately if you user angular, you need all the js files present, otherwise it doesn't work for that file, in my experience. – Lombas May 06 '16 at 11:44
  • @Lombas It should only affect intellisense and you can add references to specific files at the top of your js if something is needed in one place. It is extemely unlikely that you need to be able to reference every javascript file in your project from every other one (you've got big structural problems in your project if you do). The _references.js file should only really need to contain references to angular and other libraries that are used throughout your project. – Mog0 May 11 '16 at 15:09
  • @Mog0 I understand, and I would rephrase my statement. If you user angular, you need more than just the libraries in the _references.js. For example, in my app I need this statement otherwise doesn't work: "/// " This is the module I use for my controllers. I image other files like this are needed. I don't know. Have to test each one... – Lombas May 12 '16 at 16:54
7

If you're suffering due to ReSharper then below mentioned options may help.

Visual Studio configuration:

ReSharper may conflict with the other Visual Studio addins and extensions - in case of slowdowns, please try to disable the other addins one-by-one and check if it helps to speed up Visual Studio with ReSharper. Here are some examples of known compatibility issues with other addins:

Productivity Power Tools

VSCommands

Also, you may try turning off the following options under "Tools | Options | Environment | General": Automatically adjust visual experience based on client performance Use hardware graphics acceleration if available

ReSharper configuration.

Though ReSharper provides quite a few powerful and useful features, some of them can be tweaked or turned off in terms of improving the speed. Here are some examples:

Turn off Solution Wide Analysis (SWA) in "ReSharper | Options | Code Inspection | Settings", 'Analyze errors in whole solution' checkbox

Switch back to Visual Studio IntelliSense in "ReSharper | Options | Environment | IntelliSense | General" dialog Clearing caches for current solution in "ReSharper | Options | Environment | General" dialog

Here are the links:

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Sampath
  • 63,341
  • 64
  • 307
  • 441
4

This seems silly but after deleting C:\Users\{User}\AppData\Local\Microsoft\WebSiteCache everything started going fast again. If you're out of options you can try that. It's the only thing that worked for me.

Gaspa79
  • 5,488
  • 4
  • 40
  • 63
3

I had a similar problem, but only on startup;

To resolve my start issue:

I have removed extensions from Visual Studio 2012 for phones;

Repair Visual Studio 2015 same… uninstall Visual Studio 2015 (hang, not all removed)

Then use:

https://github.com/tsasioglu/Total-Uninstaller

Remove all that was possible with Visual Studio 2015, Visual Studio 2013, etc.

Install Visual Studio again error: Lookup logs, inet, etc. and found Visual C++ redist 2015. I reinstalled and repaired vc_redist.x64.exe and vc_redist.x86.exe.

I installed Visual Studio 2015 again and now I don't have any startup issues (vsHub can be uninstalled and connected services can be disabled…)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user1005462
  • 158
  • 2
  • 7
3

Same issue here, Visual Studio 2015 Pro Update 2 on a brand new machine. The editor was extremely slow, typing like chewing gum.

The reason was ESET NOD32 Antivirus 9. It has a thing called "Host Intruder Prevention System (HIPS)" enabled by default. I don't know how useful it this, but it can be disabled or I just added a rule, to allow devenv.exe.

Now it's fine.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Tom
  • 190
  • 3
  • 18
2

I had the same problem with VS 2015 Community with Node Tools.

I saw some issues about this problem in the NTVS github repository, and it may related to analysis file in the project. In fact, I have deleted this file every project load and it gets faster, but I think the safest way to improve it is ignoring some directory files like the link below.

https://github.com/Microsoft/nodejstools/wiki/Projects#ignoring-directories-for-analysis

2

It is most likely because you uninstalled some SQL Server components Visual Studio is using. Though Visual Studio still works, it's very slow.

Just go to "Programs and Features" in the Control Panel and repair Visual Studio. The needed Visual Studio components will be installed again and Visual Studio will be back as fast as before.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Dunken
  • 8,481
  • 7
  • 54
  • 87
  • Oh, this also seems help..especially Server Data Tools. It would be better to use Server Management Studio when needed..Thank you ! – Kay Lee Jan 05 '17 at 09:16
1

I experienced that when downgrading (i.e. uninstalling and reinstalling) from VS 2015 Ultimate to VS 2015 Professional, the IDE was very sluggish and constantly froze.

Doing a new clone of the repository, or - as one of my collegues tried - cleaning out all files not in source control (in the case of Git git clean -xfd), helped me get rid of the this problem. The IDE is now running smoothly again.

The assumption is that Ultimate leaves some files behind that cause this behaviour in Professional, but I have not been able to track down which.

Rosted
  • 123
  • 5
1

In my case both 2015 express web and 2015 Community had memory leaks (up to 1.5 GB) froze and crashed every 5 minutes. But only in projects with Node js. what solved this issue for me was disabling the intellisense: tools--> options--> text editor-->Node.js--> intellisense-->intellisense level=No intellisense.

And somehow intellisense still works))

JFisher
  • 41
  • 3
1

I also had this issue with Visual Studio 2015, tried everything I could read about but in the end all that was left was a clean install. I used Microsofts tool VisualStudioUninstaller to get rid of every component.

https://github.com/Microsoft/VisualStudioUninstaller

Usage:

  1. Extract TotalUninstaller.zip
  2. Open an administrator command prompt.
  3. Execute Setup.ForcedUninstall.exe
  4. Type 'Y' to uninstall.

After reinstall everything worked normally again. I did not experience lag in every project but one was causing enough pain so I really had no choice.

Read about another command that you can also try but I know VisualStudioUninstaller works, at least it did for me.

D:\vs_ultimate.exe /uninstall /force

Where D: is the location of your installation media (mounted iso, etc).

Ogglas
  • 62,132
  • 37
  • 328
  • 418
1

This might just help someone, in addition to what other answers have mentioned.

Clear the contents of AppData\Local\Microsoft\WebSiteCache folder.

In my case I had VS 2015 pro update 3 and this is what helped me speed up VS.

bit
  • 4,407
  • 1
  • 28
  • 50
1

This may help someone visiting this question.

I had an issue where it was slow only in very large files. When opening braces such as { or after completing a type, such as decimal it would hang.

This was resolved by disabling the "Show a completion list after every character is typed" setting in Options => Text Editor => C# => Intellisense

k29
  • 641
  • 6
  • 26
0

This answer might seem silly but I had my laptop's power plan set to something other than High performance (in Windows). I would constantly get out of memory warnings in Visual Studio and things would run a bit slow. After I changed the power setting to High performance, I no longer see any problem.

Bochu
  • 377
  • 3
  • 7
0

After upgrading from VS2013, I found that when debugging in Visual Studio 2015, it would freeze, I unchecked "Tools>Options>Debugging>General>Enable Diagnostics Tools while debugging" It brought debugging sessions back to normal. While Diagnostics are useful, I don't need them all the time so if at any point I need them I can turn it back on.

ldiablo
  • 67
  • 11
-2

Update PC Drivers

In my case, and I had bad lag doing the simplest of things, it helped to update my pc drivers. The system drivers are the foundation for everything.

I was fortunate that I have Dell and they have awesome website support to do this. I googled

dell <my model name> update drivers

or go to the drivers home page

I let it update all the drivers it wanted to (Dell driver update is pretty much automatic).

Much of the lag seems to have gone away.

toddmo
  • 20,682
  • 14
  • 97
  • 107