New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orleans not recognising ServerGC setting #4418

Closed
dandago opened this Issue Apr 7, 2018 · 18 comments

Comments

Projects
None yet
5 participants
@dandago
Contributor

dandago commented Apr 7, 2018

I am running Orleans in a .NET Core console app. The project is basically the same as #4417.

In order to turn on ServerGC, I follow this Stack Overflow answer and add the following in my .csproj file:

<PropertyGroup>
  <ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>

Despite this, I still get the following warning:

info: Orleans.Runtime.Silo[100404]
Silo starting with GC settings: ServerGC=False GCLatencyMode=Interactive
warn: Orleans.Runtime.Silo[100405]
Note: Silo not running with ServerGC turned on - recommend checking app config : --
warn: Orleans.Runtime.Silo[100405]
Note: ServerGC only kicks in on multi-core systems (settings enabling ServerGC have no effect on single-core machines).

@dandago

This comment has been minimized.

Contributor

dandago commented Apr 8, 2018

Seeing the relevant docs, perhaps I am just missing the concurrent garbage collection setting. I'll test this soon.

@sergeybykov

This comment has been minimized.

Member

sergeybykov commented Apr 10, 2018

Are you using the old .csproj format by chance? It requires an app.config file to achieve the same. See #4440.

@sergeybykov sergeybykov added this to the Triage milestone Apr 10, 2018

@dandago

This comment has been minimized.

Contributor

dandago commented Apr 10, 2018

No, I was using a .NET Core project. I'll check if the concurrent garbage collection setting fixes this.

@dandago

This comment has been minimized.

Contributor

dandago commented Apr 10, 2018

OK, I am still getting the warnings. I am following the docs to the letter, so I have this in my .NET Core csproj:

<PropertyGroup>
 <ServerGarbageCollection>true</ServerGarbageCollection>
  <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
</PropertyGroup>

Perhaps Orleans is looking specifically for the old App.config settings? I get that impression from the warning - its instructions are App.config-specific:

image

@benjaminpetit

This comment has been minimized.

Contributor

benjaminpetit commented Apr 23, 2018

I just retested locally, and I have no issue:

info: Orleans.Runtime.Silo[100404]
      Silo starting with GC settings: ServerGC=True GCLatencyMode=Interactive

Did you try to rebuild?

@galvesribeiro

This comment has been minimized.

Member

galvesribeiro commented Apr 23, 2018

@benjaminpetit I can confirm the issue happens to me as well in a brand new project.

@dandago

This comment has been minimized.

Contributor

dandago commented Apr 23, 2018

There's a second repro in my last article (different project). That includes code and a screenshot showing the problem.

@benjaminpetit

This comment has been minimized.

Contributor

benjaminpetit commented Apr 23, 2018

image

I will try your project @dandago

@benjaminpetit

This comment has been minimized.

Contributor

benjaminpetit commented Apr 23, 2018

@dandago I tried your sample, it didn't have the GarbageCollection settings in the csproj. But with them it works fine:

image

@dandago

This comment has been minimized.

Contributor

dandago commented Apr 23, 2018

That's the wrong article :) Check the "Getting Organised" (i.e. the one I linked) one, not the "Getting Started".

I just rechecked, and tweaked the project to be exactly like yours (had to make a code change due to the LangVersion), and I still get the same issue:

image

@benjaminpetit

This comment has been minimized.

Contributor

benjaminpetit commented Apr 23, 2018

Sorry for the wrong solution.

But taking the solution from "Orleans2GettingOrganised", it works out of the box:

image

Could you try to delete manually the output folder and then rebuild and run?

@benjaminpetit

This comment has been minimized.

Contributor

benjaminpetit commented Apr 23, 2018

@dandago @galvesribeiro check that the {YourDllName}.runtimeconfig.json looks like this:

{
  "runtimeOptions": {
    "tfm": "netcoreapp2.0",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "2.0.0"
    },
    "configProperties": {
      "System.GC.Concurrent": true,
      "System.GC.Server": true
    }
  }
}
@dandago

This comment has been minimized.

Contributor

dandago commented Apr 23, 2018

The GC settings in that JSON file were missing. After deleting the bin and obj folders and rebuilding, they were there, and Orleans recognised the GC settings, so problem solved.

It would be useful to understand how this file gets generated and why the settings would be missing despite being in the csproj.

@benjaminpetit

This comment has been minimized.

Contributor

benjaminpetit commented Apr 23, 2018

I would assume this is a tooling issue, but maybe Orleans codegen is playing a role here?

@benjaminpetit

This comment has been minimized.

Contributor

benjaminpetit commented Apr 23, 2018

Other though: are you using the latest VS version?

@galvesribeiro

This comment has been minimized.

Member

galvesribeiro commented Apr 23, 2018

Ok cool. I can confirm that deleting bin/ and obj/ sorted the issue. Thanks!

@dandago

This comment has been minimized.

Contributor

dandago commented Apr 24, 2018

I am on VS 15.6.5. Latest seems to be 15.6.6. Just one version behind.

@ReubenBond

This comment has been minimized.

Contributor

ReubenBond commented Apr 24, 2018

Almost certain this has nothing to do with Orleans codegen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment