0

Something with hotchoclate library just makes Visual Studio freeze at 100% CPU so that we have to kill VS and reopen.

It happens over and over again. After a short moment of coding VS just freezes up.

(https://chillicream.com/docs/hotchocolate/v13)

Situation

MS Web APU project with hotcholcolate (HC) graphql v13. we changed into using annotation-based HC types.

Our Entity Framework Core classed are extended using ExtendObjectType<myClass> and our resolvers go there.

We also use the HotChocolate.DataLoaderAttribute that generates loader code for us, in HotChocolateDataLoader.g.cs class. Like:

[DataLoader] 
public static async Task<IReadOnlyDictionary<Guid, Person>> GetPersonBatchAsync( 

Problem

And this is where the problem is. After making 30-40 extension classes and a few dataloader classes, my Visual Studio just freezes after a few minutes of editing files with ExtendObjectType or DataLoaderAttribute.

The freeze only happens if I edit an extension class (ExtendObjectType<myClass>) or a class with [DataLoader]. Both of these types will make HC regenerate these two files in the background: HotChocolateDataLoader.g.cs and HotChocolateTypeModule.g.cs.

In lower left corner of VS I can see status "running low priority background process. Evaluating (4 tasks in queue)", and this stays on forever until i kill VS process, that is running 100% CPU forever.

Right after starting VS I can see that background process complete fine with "Loading Intellisense. Loaded", "Indexing files in mySolution" and "Project loaded and ready to use".

So, something must be wrong with HC library?

We started experiencing this after our project became a certain size as mentioned.

Earlier on in project we had no problems with HC, but then we used only Code-First notation. Lots of resolvers and batchdataloaders. Problem free.

Someone else must have experienced this? So far we find nothing we can do with today's situation. Does anyone have any tips?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Lava
  • 69
  • 9
  • Did you had the chance to check into process log which one consuming more memory? Does this happening only for the perticular app or all app while running Visual Studio instance? – Md Farid Uddin Kiron Jul 21 '23 at 09:31
  • only this one api app, which is the only one using hotchocolate graphql package. Looking into process list and sub processes of Visual Studio I se two sub processes using alot CPU. one only named " Visual Studio" and the other is sometime, but not always, something name Roslyn Code Analysis – Lava Jul 21 '23 at 13:39

0 Answers0