dotnet / dotnet/core

Dotnet run start many processes

Open
#4,702 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
22k
Forks
4.9k
Avg merge
5d 5h
Merged PRs (30d)
29

Description

I have previously always started my services using Visual Studio but have been wanting to use vscode instead and since I always start 4 services the built-in runner hasn't worked that well for me so I created a small powershell script that starts up the services, either in watch or in normal run mode ( my reasoning was to use a little bit less memory but haven't seen any big difference ).

So these 4 services seems to start up 52(!) processes and use over 1,5gb ram and my services uses less than 350mb. Also it seems like when I kill the terminals the .NET Core hosts are still running and using memory but my services are gone. Why does one service start up 25 processes but another only 5? Could it be references to other projects in the solution?
Is there any way to fix this? Maybe there's a better what to start them up?

Basically what I want to achieve is to start some services, some of them (where I will do my work) should run watch and the other should just start up and use as little memory as possible.

I am using version 3.1.202 and Windows 10

`if($service -eq 'y') {`
` Start-Process -FilePath 'dotnet' -ArgumentList 'watch -p service\Service.csproj' run'`
` } else {`
` Start-Process -FilePath 'dotnet' -ArgumentList 'run -p service\Service.csproj'`
` }`

![image](https://user-images.githubusercontent.com/5585719/82293768-615b8080-99ad-11ea-8837-b982049eaaa5.png)

![image](https://user-images.githubusercontent.com/5585719/82293929-9bc51d80-99ad-11ea-8b2c-d12064f35650.png)

Update:
After leaving it by it self for some time, it actually looks okay! But if I restart them I get all the 52 processes again...
![image](https://user-images.githubusercontent.com/5585719/82364654-deb7dd00-9a0f-11ea-8a7f-269b45cb4507.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.