Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetMemoryPressure()

static MemoryPressure System.Buffers.Utilities.GetMemoryPressure ( )
inlinestaticpackage

Definition at line 27 of file Utilities.cs.

28 {
29 GCMemoryInfo gCMemoryInfo = GC.GetGCMemoryInfo();
30 if ((double)gCMemoryInfo.MemoryLoadBytes >= (double)gCMemoryInfo.HighMemoryLoadThresholdBytes * 0.9)
31 {
32 return MemoryPressure.High;
33 }
34 if ((double)gCMemoryInfo.MemoryLoadBytes >= (double)gCMemoryInfo.HighMemoryLoadThresholdBytes * 0.7)
35 {
36 return MemoryPressure.Medium;
37 }
38 return MemoryPressure.Low;
39 }

References System.GC.GetGCMemoryInfo(), System.GCMemoryInfo.HighMemoryLoadThresholdBytes, and System.GCMemoryInfo.MemoryLoadBytes.

Referenced by System.Buffers.TlsOverPerCoreLockedStacksArrayPool< T >.Trim().