Skip to content

asp.net core ServerGarbageCollection not working #2056

@amirjalali1

Description

@amirjalali1

Asp.net core 1.1.2
windows server 2016

after migrating my project from vs 2015 to 2017 i made a release and published my website but now memory usage constantly grows in production server.

At vs 2015 i had this in my project.json :

  "runtimeOptions": {
    "gcServer": true
  },

but after migrating to vs 2017 csproj is like this

  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <AssemblyName>xxxxx</AssemblyName>
    <OutputType>Exe</OutputType>
    <PackageId>xxxxx</PackageId>
    <UserSecretsId>xxxxxxx</UserSecretsId>
    <RuntimeFrameworkVersion>1.1.2</RuntimeFrameworkVersion>
    <PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;dnxcore50;portable-net45+win8</PackageTargetFallback>
    <ServerGarbageCollection>true</ServerGarbageCollection>
  </PropertyGroup>

i also changed csproj to this in another test:

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

and runtimeconfig.template.json to this :

{
  "gcServer": true,
  "System.GC.Server": true,
  "gcConcurrent": true
}

but garbage collection is not working. any idea what is going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions