Visual Studio 2010 loads symbols too slowly when debug mixed application - performance

I'm using Visual Studio 2010 to debug a mixed application. When I attach to that process(Managed + Native), the VS is hung. Then 30 minutes later(not exactly this time, but it's really long), it comes back.
Anybody know how to resolve this?Thanks in advance!
I have 'Delete all breakpoint', tried repair VS and so on. The issue still exists.

I would guess you have a symbol server that is dead and VS is still trying to get symbols from it / VS is hitting the MS symbols server which is a slow operation / VS is not finding the symbols in the paths you have, but is still trying to hit them every time and that takes forever (both known issues that we fixed in VS 2012)
If you don't need any symbols - I would do what Hans suggested - Tool/Options/Debugging/Symbols uncheck all symbol servers, plus choose Automatically load symbols for: Only specified modules and specify your modules in that list (it can be empty as well) -> this will work if your app is trying to load a lot of symbols that you don't need. And you can later load them manually (the ones you want) from the Modules window

Related

Visual Studio Community 2015 slow debugging

I have recently bought new laptop:Hp specter x360 i7-6500 with 8gb RAM.
I have installed Visual Studios 2015 Community in an offline mode, later I updated it.I am currently working in c# window forms.
The point is when I press the button 'Start Debugging', VS build the program in normal speed, but it takes like 10-15 sec to show the output, even for the small programs. This whole thing is for first time debugging after code editing, if I close it and run it again without changing the code, it shows the output on the spot.
And if I run the same program in my old laptop, which has lower specs and same VS, that laptop show the result much quicker.
Based on your screenshot, I see that VS tries to download PDB symbols for system assemblies, which are used by your application. Loading the debug symbols provides simplify debugging of an application but it also slows down the application loading.
You can change symbols loading settings, in the Tools-Options-Debugging-Symbols menu of Visual Studio. Here you can disable symbol loading (if you would use this option you need to load symbols manually using the Debugging-Windows-Modules interface). Or exclude system modules which usually are not necessary to debug a common application.
Check this blog post which provides a great description about how VS uses debug symbols.

Visual Studio Devenv.exe high cpu Usage

I am using VS 2013 ultimate, working on a project with Team Foundation Server. The problem is, every ten seconds, it hangs for up to 5 seconds, I am not compiling or anything, just writing code. Devenv.exe process jumps to more than 25% CPU and 670k of RAM. I have looked at the output from the JavaScript Language Service, and it constantly checks and says Referenced file 'D:\tfs\xxx.aspx' not found. Text search of the filename xxx.aspx in entire solution turns up nothing and I have the latest version. I think this is the reason of the spikes, does anyone know how I can turn off this feature in VS 2013?
EDIT: I have looked at other solutions, Browser Link is closed, I have the latest update
EDIT: I have found the solution, but I dont think it will really help anyone else. One of the guys referenced a hard drive path on top of a javascript page, and since the project is tens of thousands lines, cpu spiked as Visual Studio was searching it. Deleting the references helped in my case.
To narrow down this issue:
Try to disconnect from TFS server. (In VS→ Team → Disconnect from
Team Foundation Server) Check whether this abnormal phenomena still exist.
Use devenv/resetuserdata command to clear user settings of VS,
details refer to this blog: VSTS Tip: devenv /resetuserdata
If you are using proxy in your machine, try to disable the proxy
settings.
If there is anti-virus in the machine, also try to disable it.

Design-time debugging in Visual Studio 2010

I have the following problem with design-time debugging in Visual Studio 2010 Pro.
In my solution I have got two libraries. One with name Alfa that contains some of my basic components. Two with name AlfaDesign that it contains designers for components from library Alfa. And of course I have a project for developing and testing Alfa components.
AlfaDesign is having reference to Alfa library. And the test project is having a reference to Alfa and AlfaDesign.
And my problem:
When I put breakpoint in component's constructor from the Alfa library and then I put this component on the form in my testing project, the debbuger is doesn't break. Visual Studio is still running.
I followed instruction from the tutorial Walkthrough: Debugging Custom Windows Forms Controls at Design Time, but without any success.
I ran into this problem today with one of my projects, and I spent the last several hours figuring it out. What I found is that the symbols and modules will not load when your project target framework is set to anything less than .NET 4 when doing an F5 debug. Switching the projects to .NET 4 does fix this weird behavior, but you may not want this for .NET 2 applications that you don't want to use the newer runtimes/BCL.
However, you can still correct this behavior. You can run manually use Debug -> Attach To Process and select devenv.exe and that will load the modules and symbols. So, you can either have a second instance of Visual Studio 2010 already open and simply attach, or you can run it on debug (Run External Program), Detach, and Re-attach to get the modules to load.
I thought this was something wrong with my environment settings, because my install of Visual Studio is very customized, so I thought there might have been some sort of setting, conflict, or file difference, but it seems to just be a weird behavior in the Visual Studio 2010 debugger. I would be curious to see if anyone from the Visual Studio 2010 team could investigate this a bit further.
If the breakpoints are properly resolved, then it must hit properly.
Please check the following.
Is the breakpoint resolved properly or not. If it's properly resolved, it will be displayed in red during debugging sessions. Otherwise the red will turn into a disabled state (with a yellow exclamation mark with a grayed circle).
Why don't you put a breakpoint where the object is being constructed and debug through it? So that you can ensure that your construction code is working well. You can step through (F11) to get inside the constructor.

How to disable symbol loading when debugging a Visual C++ program?

I am using Visual Studio 2008. I don't need to debug some DLLs in my project, so can I disable symbol loading when debugging a Visual C++ program? Does it help to make startup time faster when debugging?
The symbols are all local, so I don't have those slow loading problem, just want to make debugging faster and faster.
For example I am using Qt libraries, when I hit "Starting Debugging", the Output window shows that the symbols for Qt libraries are loaded. If VS can stop loading those symbols, the debugging startup time should be faster. Of course, I still want VS to load symbol for my executable.
Just found out that Visual Studio 2010 actually do what I want.
To load only the symbol for your executable file, without loading other symbols (eg: DLLs):
Go to Tools->Options->Debugging->Symbols
Click "Only specified modules"
Clear "Always load symbols located next to modules"
Click "Specify modules"
Click the new icon
Enter your executable filename (eg: my-awesome-app.exe)
Also found out that Visual Studio 2010 seems to perform better than Visual Studio 2008 when debugging. At least the IDE layout switches back faster when the debugging is stopped.
I am not sure what you mean by 'startup'. I assume you are talking about the launching of the actual application. The time to launch the target application is expensive regardless of mode you launch it. It may be less in Release but that will be negligible.
Turning off all symbol paths as mentioned in the other solution is a viable option. However, I am not sure why you are debugging if you do not want symbols for your launched application. Without the applications symbols you will not be able to see where you are in the source code when you are debugging.
If you are looking for a faster debugging experience you can use WinDbg. It comes with the Windows SDK but can also be downloaded seperately. If is a faster UI than Visual Studio, but it is much more cumbersome to use if you are more comfortable with a GUI. WinDbg uses commands to perform almost all tasks, but you can do some great debugging and it is faster in many cases compared to Visual Studio. In the event you want to debug C++\CLI or any managed application (e.g. C#), I would stick with Visual Studio. There is an extension in WinDbg called SOS, but it requires some advanced debugging experience to use correctly.

Visual studio 2005 hangs when debugging

Visual studio debugger hangs while loading symbols for my application(native IA64), SP1 is installed. This started to occur, after i install debugging tools for windows(64 bit version), and reboot my computer. This issue is not depend on my project, even with new project debugger hangs.
UPDATE:
When i try to attach to the running process, the same situation repeats. Visual studio hangs while loading symbols(for kernell32.dll)
symsrv.dll is responsible for loading symbols from a symbol server - you might try renaming the one installed by Debugging Tools for Windows and see if the VS debugger starts working again.
Is it completely hanging, or just taking a long time to load the symbols?
If you using a symbol server to access debug symbols for the Windows DLLs, VS2005 can try to access the symbol server every time you debug.
The way around this is to load the symbols once, and then uncheck the symbol server URL under Tools->Options->Debugging->Symbols. As long as the OS libraries haven't changed since you last downloaded the symbols, there's no reason to access the remote server every time.
Also see this answer.

Resources