diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-07-31 22:41:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-31 22:41:26 -0500 |
| commit | 39f3fd93a4d3c119aade7b3d8a6c58eb7938b853 (patch) | |
| tree | 738a513f21cd9141eaa7577d78f19d1e15f3a25e | |
| parent | 0791bd27e6fc2986d8ad12b0bd7d797af92fc383 (diff) | |
| parent | f38fce05915e26c194636fc66d136974ed2db9cd (diff) | |
| download | slskd-39f3fd93a4d3c119aade7b3d8a6c58eb7938b853.tar.gz | |
Merge pull request #571 from slskd/memory
Tweak options related to garbage collection
| -rw-r--r-- | Dockerfile | 3 | ||||
| -rw-r--r-- | src/slskd/Application.cs | 2 | ||||
| -rw-r--r-- | src/slskd/slskd.csproj | 1 |
3 files changed, 4 insertions, 2 deletions
@@ -50,6 +50,9 @@ VOLUME /app HEALTHCHECK --interval=60s --timeout=3s --start-period=5s --retries=3 CMD wget -q -O - http://localhost:${SLSKD_HTTP_PORT}/health ENV DOTNET_BUNDLE_EXTRACT_BASE_DIR=/var/tmp/.net \ + DOTNET_gcServer=0 \ + DOTNET_gcConcurrent=1 \ + DOTNET_GCHeapHardLimit=1F400000 \ DOTNET_GCConserveMemory=9 \ SLSKD_HTTP_PORT=5000 \ SLSKD_HTTPS_PORT=5001 \ diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 1c7031cc..cd45fbeb 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -180,7 +180,7 @@ namespace slskd GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; #pragma warning disable S1215 // "GC.Collect" should not be called - GC.Collect(2, GCCollectionMode.Forced, blocking: false, compacting: true); + GC.Collect(2, GCCollectionMode.Forced, blocking: true, compacting: true); #pragma warning restore S1215 // "GC.Collect" should not be called sw.Stop(); diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index 2f5ec67c..27cd2a30 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -12,7 +12,6 @@ <LangVersion>9.0</LangVersion> <CodeAnalysisRuleSet>Properties\analysis.ruleset</CodeAnalysisRuleSet> <GenerateDocumentationFile>true</GenerateDocumentationFile> - <ServerGarbageCollection>false</ServerGarbageCollection> <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> </PropertyGroup> |
