Visual Studio Attach To Process takes a -long- time to show up

Viewed 5848

Since about a month or 2, the Visual Studio 2015 Attach to Process dialog takes 1-2 minutes to show up on one of my machines. It used to take just a few seconds, it feels as if it is suddenly taking an enormous effort to retrieve the process list.

Needless to say, this is taking the swiftness out of my ad-hoc debugging sessions. Any tips to get it back into the previous working state, or insights into the underlying cause, would be much appreciated.

For those who do not know what the Attach to Process dialog looks like :)

Restarting the computer (e.g. after a Windows Update reboot) temporarily fixes the issue.

Note: The attaching itself works fine, and is as fast / slow as ever. Most related questions seem to be about symbol loading, but that bit is working nicely.

Additional details

  • My computer has modest specs (16GB mem, fast SSD, i5-6600) for a dev machine.
  • According to the task manager, it is not working particularly hard while retrieving the process list. Will inspect more in detail.
  • As an experiment, I waited until things got slow again, and randomly started shooting down processes using Process explorer, reducing the number of processes from 261 to 209. Fast as ever now. Seems one of these processes is the culprit (or perhaps there is a bit flip in VS at > 256 processes :D), now I only have to wait for things to become slow and do further testing.
3 Answers

Visual Studio 2015

In Visual Studio 2015 the attach process dialog doesn't open until all the processes are ready. This has been changed in more recent versions to open immediately and then progressively show the processes as they become ready.

Quoting a support response from the Visual Studio Team

Visual Studio 2015 wouldn't open the dialog until the list of processes was ready, but for 2017 we changed the dialog to open immediately and show the processes list once it is ready.

Source: Visual Studio Developer Community: Attach to process really slow

So I suspect that there may be something else related to the machine that is slowing down the processes.

The machine

Now you say it's on one machine and with all things being equal with your Visual Studio usage, settings, project type, etc. Then it's likely an issue with your machine.

I've had similar difficulties with all my windows machines over the years. They start off fast and then end up painfully slow for developing. The fact the problem is rectified on reboot, indicates there's some issue, perhaps a memory leak? that's causing the pc to slow down.

What I would do to attempt to improve performance:

  • Go through all the startup programs and disable most of them.
  • Uninstall any third party security software. They take up a hideous amount of processing. Use the inbuilt Windows 10 security features.
  • Ensure the pc is regularly defragmented and unused files are deleted.
  • Check task manager for which processes are using up the CPU or memory (or disk). There may be things that can be done if you find the troublesome area.
  • Reinstall Visual Studio and it's dependencies from scratch.
  • Reinstall Windows and then reinstall VS.
  • The pc may not be adequate for the job. Upgrade or even better replace it.

I switched from Windows to Mac earlier this year, as I'd had enough of the bugs in Windows and the gradual decrease in performance. I forked out for a brilliant machine and haven't looked back.

The up and download speeds alone, on the same network as the Windows machine is 10 times faster. Everything about it is faster. The CPU on the Windows running on Parallels is actually faster. I can have Android studio stable, plus the beta open and run Visual Studio on Parallels, have chrome running and many other smaller apps and it will run faster.

I'll come back to you if this changes, but I honestly think it's a superior machine, OS, and hardware. This is coming from using State of the Art Windows machines. The best Windows machine was a gaming laptop, for performance. It too deteriorated until it just stopped working.

See if Python installed as Visual Studio Workloads. If yes, then Uninstall Python Workload. Its easy to uninstall workloads. Open Visual studio installer enter image description here

enter image description here

Uncheck the checkbox for Python and click modify button. It will take a while. When setup is finished. You are good to go.

enter image description here

Related