Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Visual Studio GUI random freezes/unresponsiveness?
ivanz
#1 Posted : Tuesday, February 28, 2012 3:42:36 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 12
Location: London, United Kingdom

Was thanked: 1 time(s) in 1 post(s)
I have been using NCrunch for a while, but the random Visual Studio UI freezes and unresponsiveness is starting to get in my way.

Every now and then when I save the current file Visual Studio will freeze become unresponsive for ~30 seconds.

I have already lowered the number of CPU cores assigned to NCrunch to only 2 and the remaining 6 to Visual Studio, but that doesn't seem to help. Isn't NCrunch meant to work completely in the background, because it almost looks like it's blocking the UI thread or something?

I am using version: 1.37.0.46b on a fast Intel i7 machine with an SSD drive.
Remco
#2 Posted : Tuesday, February 28, 2012 8:26:37 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi, thanks for posting!

Yes - NCrunch is not supposed to block the UI thread. However, it does have a big impact on your overall system load, so if you're running several big heavy tests in the background (perhaps that do a large amount of I/O or interact with locally hosted databases), responsiveness issues are still possible. Something you can try is to reduce the 'max number of processing threads' configuration option to a lower number, as less things happening concurrently will put less strain on your system resources. If the grinding becomes too extreme, you may want to look at running in manual mode.

I've been trying to track down situations that can cause this to better improve the experience - so if there's anything more you can tell me about the tests you're running, this would be a huge help.


Cheers,

Remco
ivanz
#3 Posted : Thursday, March 1, 2012 10:35:46 AM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 12
Location: London, United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Hi,,

Thanks for your reply. I have lowered the cores to 1 for ncrunch, threads to 1 and processes to 2 and it's still happening :(. I see no such issues when I run the same tests with the CodeRush test runner :/. I also think that the freeze is not happening during the test run, but rather during the "reprocessing" part when it rebuilds the assembly and before it runs the tests. The more often I save the more often it happens. ;)

Can I enable debug/verbose mode to see where it gets stuck?

Also when I disable NCrunch I can see that its processes "Ncrunch.runner.exe" or similar remain active.

P.S: Email notifications for this forum don't seem to work.
Remco
#4 Posted : Thursday, March 1, 2012 8:43:03 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks for the tip about email notifications - I was wondering if this was an isolated issue, but it seems something isn't right with the mail server ...

Can you share any more details about the solution your working in? I.e:

* How large is your codebase? (approx lines of code would be great)
* How many project files do you have and are any of these unusually large?
* How many tests?
* Do you have many big integration tests? (i.e. that interact heavily with the file system, databases, etc)
* Are you using any specialised SDKs or custom build steps?

You can enable verbose logging to the output window and this will show information about what the engine is doing, but sadly this won't tell us what is causing the responsiveness issues.


Thanks!

Remco
ivanz
#5 Posted : Wednesday, March 7, 2012 3:10:04 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 12
Location: London, United Kingdom

Was thanked: 1 time(s) in 1 post(s)
* Code base is ~18,000 lines (*.cs) + maybe ~3000 in *.cshtml ASP.NET MVC views. There are 21 projects in the solution (in the middle of a large refactoring)

* Unfortunately only 163 tests (as per what NCrunch reports) - NUnit and MSpec

* Building the solution from Clean to full build with VS takes 1 minute 10 seconds.
* Running all tests with the CodeRush unit test runner (tests run synchronously) takes 1 minute 30seconds

* Maybe half of those are small integration tests that initialize/destroy a local SQL database programatically (using fluent migrator) before each fixture. Definitely not resource heavy though (clearly slower than standard test, but still not that resource heavy).

* Custom build steps:
- PostSharp (added recently - was seeing the VS ui freeze problems before that)
- NuGet with package restore - I have just added ".\packages\**.*" to the solution "Additional files" to avoid package downloads each time.
- 1 custom post-build step where I copy 15 small files over using xcopy
ivanz
#8 Posted : Wednesday, March 7, 2012 4:58:32 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/28/2012(UTC)
Posts: 12
Location: London, United Kingdom

Was thanked: 1 time(s) in 1 post(s)
Interestingly it might appear that the culpit was nuget with package restore. Now that I have added the packages folder to the list of files to copy over before an NCrunch build I see VS freeze less often. I will test some more to see if it's not just something temporary.
Remco
#9 Posted : Wednesday, March 7, 2012 9:48:21 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
With the project size you've described, NCrunch should be absolutely flying. I find it a bit surprising that Nuget package restore would be causing poor responsiveness in the IDE (i.e. lockups and such), though it isn't a surprise to me that it would add to your build times. NCrunch 1.37 introduced an auto configuration feature for Nuget package restore, and the alternative to this was to add the packages folder to the 'Additional files to include' setting as you've done. I'm keen to hear how your further testing goes - hopefully you've found the culprit.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download