Daily Usage Issues

Rider freezes UI very often when combined with NCrunch

Started by TimVisma on 36,421 views

Unfortunately I still have the freeze problem.
TimVisma wrote:Unfortunately I still have the freeze problem.


Sorry, looks like I'm going to need another capture like the last one.
Remco wrote:
TimVisma wrote:Unfortunately I still have the freeze problem.


Sorry, looks like I'm going to need another capture like the last one.


I have send you the new log files in the contact form.
Thanks for sending through the log.

Through an expensive process of deduction and rewriting a lot of code, there's probably not much left that can cause this. My latest suspicion is that the problem is being caused by thread pool starvation. I've implemented a change that I hope will solve it. Would you be interested in giving it a try?

NCrunch_Console_5.21.0.1.msi
NCrunch_Console_5.21.0.1.zip
NCrunch_GridNodeServer_5.21.0.1.msi
NCrunch_GridNodeServer_5.21.0.1.zip
NCrunch_LicenseServer_5.21.0.1.zip
NCrunch_Rider_5.21.0.1.7z
NCrunch_Rider_5.21.0.1.zip
NCrunch_VS2010_5.21.0.1.msi
NCrunch_VS2010_5.21.0.1.zip
NCrunch_VS2012_5.21.0.1.msi
NCrunch_VS2012_5.21.0.1.zip
NCrunch_VS2013_5.21.0.1.msi
NCrunch_VS2013_5.21.0.1.zip
NCrunch_VS2015_5.21.0.1.msi
NCrunch_VS2015_5.21.0.1.msi.7z
NCrunch_VS2015_5.21.0.1.zip
NCrunch_VS2017_5.21.0.1.msi
NCrunch_VS2017_5.21.0.1.msi.7z
NCrunch_VS2017_5.21.0.1.zip
NCrunch_VS2019_5.21.0.1.msi
NCrunch_VS2019_5.21.0.1.msi.7z
NCrunch_VS2019_5.21.0.1.zip
NCrunch_VS2022_5.21.0.1.msi
NCrunch_VS2022_5.21.0.1.msi.7z
NCrunch_VS2022_5.21.0.1.zip
NCrunch_VS2026_5.21.0.1.msi
NCrunch_VS2026_5.21.0.1.msi.7z
NCrunch_VS2026_5.21.0.1.zip
Remco wrote:Thanks for sending through the log.

Through an expensive process of deduction and rewriting a lot of code, there's probably not much left that can cause this. My latest suspicion is that the problem is being caused by thread pool starvation. I've implemented a change that I hope will solve it. Would you be interested in giving it a try?

NCrunch_Console_5.21.0.1.msi
NCrunch_Console_5.21.0.1.zip
NCrunch_GridNodeServer_5.21.0.1.msi
NCrunch_GridNodeServer_5.21.0.1.zip
NCrunch_LicenseServer_5.21.0.1.zip
NCrunch_Rider_5.21.0.1.7z
NCrunch_Rider_5.21.0.1.zip
NCrunch_VS2010_5.21.0.1.msi
NCrunch_VS2010_5.21.0.1.zip
NCrunch_VS2012_5.21.0.1.msi
NCrunch_VS2012_5.21.0.1.zip
NCrunch_VS2013_5.21.0.1.msi
NCrunch_VS2013_5.21.0.1.zip
NCrunch_VS2015_5.21.0.1.msi
NCrunch_VS2015_5.21.0.1.msi.7z
NCrunch_VS2015_5.21.0.1.zip
NCrunch_VS2017_5.21.0.1.msi
NCrunch_VS2017_5.21.0.1.msi.7z
NCrunch_VS2017_5.21.0.1.zip
NCrunch_VS2019_5.21.0.1.msi
NCrunch_VS2019_5.21.0.1.msi.7z
NCrunch_VS2019_5.21.0.1.zip
NCrunch_VS2022_5.21.0.1.msi
NCrunch_VS2022_5.21.0.1.msi.7z
NCrunch_VS2022_5.21.0.1.zip
NCrunch_VS2026_5.21.0.1.msi
NCrunch_VS2026_5.21.0.1.msi.7z
NCrunch_VS2026_5.21.0.1.zip



I've installed the new version. I'll test it out. Hopefully, the issue is resolved.
I had my best Rider/NCrunch Week in ages with Rider 2025.3.01.... can't remember a freeze.

But this could be just luck. But had the don't find SDK problem.

Edited

I've been using the new version of NCrunch for a few days now, and I haven't really noticed any freezes anymore (at least not as often or as quickly ;). Every now and then, a complete freeze occurs throughout Windows, but that's most likely due to a Slack issue (https://www.reddit.com/r/Slack/comments/1o0ee8e/slack_desktop_for_windows_keeps_freezing_window/).

Thank you so much Remco for resolving the issue. What was the likely cause?

If I experience freezes again, I'll report them in this thread.
Finally! I did have high hopes on that last fix.

We were starving the thread pool for the IDE. It wasn't obvious, but the background threads being used for transferring NCrunch data into editor windows were being allocated from the same pool as the threads used by the IDE for everything else, which apparently has a limit. This explains the erratic nature of the issue, and why the freezes were of variable length. When the IDE would try to allocate a thread for an important foreground task, it would sometimes need to wait until a thread became available. The problem would get worse when more editors were open in the IDE.

Interestingly it wouldn't take many threads for the pool to hit the limit. The IDE must run quite close to it during normal operation.

Edited

I just wanted to chime in.

v5.20 didn't fix the UI hanging but v5.21 seems very smooth so far. RIder 2025.3.1
Hi,

I am on NCrunch 5.21.0.2, Rider 2025.3.3. I am experiencing this quite often; UI freeze with Alt-Tab back and forth solving it.

Let me know if I can provide more info.

Cheers
Working on a test heavy solution now, even with NCrunch not enabled, rider still hangs quite a lot, every couple of minutes I have to alt tab back and forth so it unfreezes. As soon as I remove NCrunch's plugin, the hanging stops.

NCrunch 5.21.0.1 and Rider 2025.3.3.
Could you check the logs under Rider to see if it reports a reason for the hanging? Usually when the UI is unresponsive, it takes a full thread dump. You can find these by going through Help-Diagnostic Tools-Show Log in Explorer.
Sure. I have a couple of threadDumps-freeze logs mentioning ncrunch. How do I get them to you?
Could you zip them up and put them through the contact form?
I uploaded some more yday. Did you receive those?

Cheers
Oddly, they didn't come through. There is a size limit of around 10MB. Are you maybe able to strip out the parts that seem less relevant?

Something that would also be interesting to know is whether the performance issue shows up when the NCrunch engine is disabled (but the plugin is still loaded in the IDE).
Thanks for sending through the pruned logs. I've taken a look through them. This set of logs doesn't contain anything that directly points to NCrunch being responsible for a performance issue. There are NCrunch threads shown in the logs, but these are all background ones that are well disconnected from the UI and they are all in a suspended state (i.e. waiting for work to do).

I'm wondering if you could share more information about the nature of this issue.

- Can you find any pattern around when it occurs?
- Does it happen while the NCrunch engine is disabled?
- How long are the freezes?
- Do they happen only when typing out code, or when doing anything in the IDE?
- Does the IDE itself detect that the thread is hung and give you an option to capture the stack?
- Does the performance issue itself seem to be specific to large solutions only?
Remco wrote:Can you find any pattern around when it occurs?

Not really, it just feels somewhat random. I could be clicking the solution explorer, scrolling through a file, navigating using Rider's shortcuts.

Remco wrote:Does it happen while the NCrunch engine is disabled?

Yes, even when the engine is disabled the freezes still occurr. The only way to make it go away for sure is to completely disable NCrunch. No tool windows shown, not pinned to any dock whatsoever.

Remco wrote:How long are the freezes?

Roughly 3-5 seconds each time. Can happen multiple times per minute, I've got 20gb allocated to rider (usually caps around 5-6gb, one, maybe two instances open at any given time).

Remco wrote:Do they happen only when typing out code, or when doing anything in the IDE?

Anything.

Remco wrote:Does the IDE itself detect that the thread is hung and give you an option to capture the stack

Nope.

Remco wrote:Does the performance issue itself seem to be specific to large solutions only?

I thought that would be the case but going back to small-mid size projects and the hanging has been somewhat severe, my initial impressions were misjudged. Currently running on 5.21.0.1.

One very peculiar behavior is that whenever a freeze happens, if I alt-tab to any other window, aside from Rider's, the UI responds immediately and the hanging is gone. Maybe this could be useful?
I haven't gotten around to sending you logs, I'll do it soon.

Edit: I have nothing inside my threaddumps-freeze folders so I guess Rider doesn't even detect it as a proper freeze on its side. Any other log I can send your way?

Edited

Thanks for this extra information. This is all very helpful. From what you've described, the problem feels like it's resource related.

I'm wondering about its consistency. Does the problem present itself consistently enough that if it were gone, you'd know within 5 minutes? Or do you get periods of usage where it normally doesn't present, then it suddenly shows up?

The reason I ask this is that I presently have no way to try and identify the issue outside of more code reviews and providing you with test builds. I can't produce the problem on my side, and the JB diagnostics are strangely not providing any useful information. All I can really do is try and make a guess, then send a new build. It's not an efficient way to troubleshoot. If the problem is present all the time while you work, at least the test builds can get us an immediate answer.
Remco wrote:Does the problem present itself consistently enough that if it were gone, you'd know within 5 minutes? Or do you get periods of usage where it normally doesn't present, then it suddenly shows up?

I'd know for sure within five minutes. 5.20 the hangings were very common, every few seconds a 3-5 freeze would happen. Seems like for 5.21 it's down to a freeze every 20-30 seconds.

If you need any logs or any help, let me know. I'll make it a top priority to check this thread daily, if you provide me with test builds, I'll get back to you ASAP.

Post a reply

Log in to reply.