This repository was archived by the owner on Dec 18, 2018. It is now read-only.
File tree 1 file changed +14
-0
lines changed
src/Microsoft.AspNet.Server.Kestrel 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 9
9
using Microsoft . AspNet . Http . Features ;
10
10
using Microsoft . AspNet . Server . Kestrel . Http ;
11
11
using Microsoft . Extensions . Logging ;
12
+ using System . Runtime ;
12
13
13
14
namespace Microsoft . AspNet . Server . Kestrel
14
15
{
@@ -83,6 +84,19 @@ public void Start(RequestDelegate requestDelegate)
83
84
}
84
85
85
86
engine . Start ( information . ThreadCount == 0 ? 1 : information . ThreadCount ) ;
87
+
88
+ // Move all MemoryPoolBlock2 into Gen2
89
+ GCSettings . LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode . CompactOnce ;
90
+ GC . Collect ( GC . MaxGeneration , GCCollectionMode . Forced , true ) ;
91
+ GC . WaitForPendingFinalizers ( ) ;
92
+
93
+ GCSettings . LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode . CompactOnce ;
94
+ GC . Collect ( GC . MaxGeneration , GCCollectionMode . Forced , true ) ;
95
+ GC . WaitForPendingFinalizers ( ) ;
96
+
97
+ GCSettings . LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode . CompactOnce ;
98
+ GC . Collect ( GC . MaxGeneration , GCCollectionMode . Forced , true ) ;
99
+
86
100
var atLeastOneListener = false ;
87
101
88
102
foreach ( var address in information . Addresses )
You can’t perform that action at this time.
0 commit comments