multiple threads issue in visual studio debugging - asp.net

Environment: Win7 Pro, VS2013 Ultimate, asp.net website (not application), vb.net
(This is a major edit that focuses more on the problem as currently understood. Looks at this point like it might be a user-code specific issue.)
Almost complete resolution, 3/1 4:15 pm PDT: If I get rid of the nasty loop in the code, by just counting and quitting when the counter gets too high, the problem seems to go away entirely, including not leaving IISExpress with high CPU usage. Still don't know why, but maybe that's just another unexplainable IDE anomaly. Probably doesn't need any more attention.
The basic problem is breakpoints not getting hit during debug runs, and the "the process or thread has changed since last step" condition. It seems directly related to IISExpress.
If I go into task manager and kill IISExpress between debug runs, it doesn't have the problem with the breakpoints. I've tested that three times and is consistent.
Plus IISExpress shows 25-50% CPU usage.
The problem started out of nowhere a couple of days ago on VS2013 Premium. I had been testing essentially the same code for several weeks with no issue. I reinstalled Ultimate with SP4 to see if that would make a difference, however, not so.
The current code set that I'm testing does have a nasty loop in it that I'm trying to remove, however, if I step through the loop just a few times and then kill the debug I still get the problem.
I have another website on the same system that I'm testing that does not exhibit this problem and does not leave iisexpress with the high CPU usage between debug.
Any help with this would be appreciated.

Related

Xamarin forms Hardware Acceleration for Emulator Performance. (Taking a lot time to deploy)

Using Visual Studio Community 2017 and Xamarin Forms.
May be this a possible duplicate question. But Believe me I have tried almost all options as much as possible.
I tried following best even with solutions provided:-
1. armeabi-v7a processor. But still it gets about 30+ minutes to reach delpoy and no resolution even after that.
2. Installing HAXM gives error as Virtualization Enabled In Firmware: is No
3. I tried running many times without Hardware Acceleration but then it is as if a endless going on process, for half an hour to hour and still not reaching actual delpoy.
4. Windows Live Player is not working. With lot of search on google found it has in-built-bugs still.
All the searched posts are major around 1-2 years back which I saw. So my question is that is there any resolution for this issue is found. Which even takes 15 minutes to deploy but gives me running my app on android emulator?
Thank you very much in advance.
Please note:- I have attached images for more clarification.
1. systeminfo
2. My Laptop Properties
3. Android Device Added
Did you enable Vt-x in your system BIOS?

Slow page refresh times during development

We have a reasonably large ASP.NET MVC app that I work on in Visual Studio 2012 on Win 8. I have a strange issue with slow page load times after recompilation. Usually, the actual build time is about 5 seconds, then the browser opens up and it takes 1-2 minutes to load the page.
Some points:
It loads slowly whether I change a view or recompile the project completely
This is not a performance issue, everything else works really well, there is enough RAM etc.
It happens only with IIS Express. When I switch to the default development server, it works fine.
All the other devs in my team use IIS Express, but they do not have this problem.
I tried to re-install IIS and to use v7.5 instead of v8 and recreated all config files. No luck.
I tried to disable all extensions, obviously it didn't affect load times too.
There is nothing abnormal in Task Manager
It's a virtual machine on my Macbook Pro, but again – this is not a performance problem.
What else can I try?
Solved by turning off Windows Defender Service. Everything is a hundred times faster now.
UPDATE: I failed to find a reason why Windows Defender is using lots of CPU power pretty much all the time. I tried to google it and it turns out that many people have a similar problem on Win 8 with no good solution.
If you really want to leave Defender on, you can add the project folder path as an exception, but it still will be slow-ish.
Hope it helps someone.
UPDATE 2: The above still holds true in Windows 10. Especially if you're running it in a virtual machine (I run it in Parallels on Mac). The overall speed increase, not only page refresh times, is very noticeable.
UPDATE 3: Apparently Windows Defender has a habit of silently turning itself back on again. So, be wary of that.
After viewing this question and answer above I found that Windows Defender Service was already turned off for me, however, I was running AVG. I disabled AVG and sure enough the lag went completely away!
So if Windows Defender Service is turned off for you and you are running some sort of system protection like AV try disabling that.

What are some reasons ASP .NET startup would be so slow

I have Visual Studio 2010 and a pretty large web application project running on IIS 7. Startup for the web application is over a minute (75 seconds). I've attached ANTS to it and very little of the 75 seconds is my code. Most of it seems to be something like CreateAppDomainWithHostingEnvironment and BuildManager stuff. Now I know that ASP .NET will compile dynamically the first time but I certainly don't expect it to compile for that long. Why could I be experiencing this problem and what are some ways I can try to fix it or try to better understand what is taking so much time. Aksi the CPU utilization doesn't seem to be that high. I have an awesome machine.
The problem with the 75 second startup is that for developers working on this, everytime they make a change they have to wait this 75 seconds.
I am using .NET 4.0
EDIT
I ran Microsoft Network Monitor on my machine to see if there was anything suspicious going on the network. There wasn't as far as I can tell though i wasn't sure what to look for (I am familiar with network monitor though so I did have an idea of what I was doing). I tried to run it in release build and though it may have improved the performance a little bit its not really significant
EDIT
I have SQL Session state. As far as i can tell, the connection string is pointing local. For some reasons though, when examinning ANTS, i'm getting a lot PollLockedSessionCallback on many threads. The function seems to be called over 70 times. Does this help at all?
Try building the application in release mode. You can set this in the Build tab of the properties window. You might also consider pre-compiling when publishing the application before deployment.
Are you trying to access anything via a network share at startup? If so, bring those resources local for startup comparison.

How can I trace an apparent memory leak in an asp.net application?

Some background info:
We have several websites running on a 64-bit machine with IIS6
These websites all have the same core code, but different skins and content
We have a SQL 2005 database which is fairly heavily used throughout the site
Historically we've used SQL stored procs, but have been gradually transitioning to NHibernate. The majority of our code uses NHibernate now, but not all.
These sites have been running fine on our live web server for a while, although we get a few errors a day regarding SQL connectivity / deadlocking.
Last Thursday we noticed the sites going very slow, then checking task manager revealed one of the websites was hogging over 1.6Gb of memory. Ever since then we've been restarting the app and watching it slowly increase in size over the course of the day.
We apparently have a memory leak (or at least, that's the effect), but I'm losing hair trying to work out how to trace it.
It only appears to be happening on this one website, even though as far as I am aware nothing had changed in the code before it started happenning. It is, however, our busiest website so it could be a traffic issue.
Debug Diagnostics hasn't revealed any issues.
Refreshing certain pages very quickly causes the memory to jump up rapidly, then fall slightly, but all the time the gradual progression is upwards.
I cannot replicate the issue on our test servers or locally. Probably because the traffic has something to do with it.
My suspicion is that the problem lies in database connectivity / locking. However, I'm not sure how that would cause the problem specified.
Any ideas?
Edit
Okay so not exactly sure I've found the problem but we're getting closer. It's definately SQL related. The error log reveals lots of errors since last thursday.
It all happened after we ran some windows updates on our servers. One of the updates failed on the SQL server so not sure if this caused some problems.
The warnings we're getting are:
SQL Server has encountered XX occurence(s) of I/O requests taking longer than 15 seconds to complete on file .. tempdb.mdf
Where XX is anything between 17 and 90! Does that sound like a deadlocking issue?
Followed by the following erors:
Unable to complete login process due to delay in opening server connection
These coincide with our log times for when the websites have been "blipping".
We've increased the page file size on SQL server to the recommended size, as it was set to a max of 4Gb, but recommended was 12Gb. I think we may need to roll back the windows updates we did on Thursday if that doesn't fix it.
Unfortunately I can't get into Activity monitor as it tells me Timeout expired!
Edit
Okay after a reboot I'm into Activity monitor. How many sleeping processes would you say would be normal? We have roughly 127 sleeping. That's serving over 10 websites.
If there is a deadlock or timeout issue, will NHibernate not clean up its connections properly?
Okay so in the end it seems it's quite complex. Sql deadlocks and data problems, heightened it seems by anti-virus software that was locking up or choking on a file.
Turning off the anti-virus reduced the problems, but we still need to resolve the underlying data issues.

IsCmdBld.exe - Randomly Errors Out

For some reason, when I use the standalone build from InstallShield 2009 Professional, there are times when I get an error and times when the build completes successfully, with no major distinguishable reason why. The error that shows up usually reads something like:
IsCmdBld.exe - Application Error
The instruction at "0xa781543" referenced memory at "0x6a19a778". The memory could not be "written"
Click on OK to terminate the program
Now, this message only comes up sometimes, it doesn't occur with any regularity or pattern. Anybody have any ideas on this? Thanks.
If the buggy memory approach doesn't pan out, I wouldn't be surprised if there was a bug in IsCmdBld.exe causing this.
I'd hazard a guess that you've got some dodgy/incompatible RAM. If you can take the machine offline and let memtest run for 24 hrs you should have enough information to debug.
I've had a similar issue in the past with a machine where the RAM/Mobo combo would cause one or two errors about once every 24 hrs. The same RAM in another machine would be fine, and other brand RAM in that machine would be fine. Running the machine off of a UPS would also be fine, I guess that teeny tiny electricity fluctuations were just enough to highlight minor incompatibilities between the two pieces of hardware.
If that doesn't help I'd suggest taking your question over to the InstallShield forums, last IS bug I had turned out to be a bug which was lodged, fixed and a hotfix distributed.

Resources