@@ -71,6 +71,15 @@ internal sealed class RamController
7171 /// Property displaying whether the RAM monitor is enabled or not
7272 /// </summary>
7373 internal bool RamMonitorEnabled { get ; private set ; }
74+ /// <summary>
75+ /// Property displaying whether the FileSystem cache should be cleared or not during memory optimisation
76+ /// </summary>
77+ internal bool ClearFileSystemCache { get ; set ; }
78+ /// <summary>
79+ /// Property displaying whether the standby cache should be cleared or not during memory optimisation
80+ /// </summary>
81+ internal bool ClearStandbyCache { get ; set ; }
82+
7483 #endregion
7584
7685 /// <summary>
@@ -99,6 +108,8 @@ internal RamController(Dispatcher dispatcher, SfCircularGauge gauge, Label lblTo
99108 _lblAvailable = lblAvailable ?? throw new ArgumentNullException ( nameof ( lblAvailable ) ) ;
100109
101110 _ramOptimizer = new RamOptimizer ( _logController ) ;
111+ ClearStandbyCache = true ;
112+ ClearFileSystemCache = true ;
102113
103114 _ramTimer = new Timer ( ) ;
104115 _ramTimer . Elapsed += OnTimedEvent ;
@@ -176,10 +187,9 @@ private void OnTimedEvent(object source, ElapsedEventArgs e)
176187 /// <summary>
177188 /// Clear all non-essential RAM
178189 /// </summary>
179- /// <param name="filesystemcache">A boolean to indicate whether or not to clear the FileSystem cache</param>
180190 /// <param name="exceptionsList">A list of processes that should be excluded from memory optimisation</param>
181191 /// <returns></returns>
182- internal async Task ClearMemory ( bool filesystemcache , List < string > exceptionsList )
192+ internal async Task ClearMemory ( List < string > exceptionsList )
183193 {
184194 _logController . AddLog ( new ApplicationLog ( "Clearing RAM memory" ) ) ;
185195
@@ -190,7 +200,11 @@ await Task.Run(async () =>
190200 double oldUsage = RamUsage ;
191201
192202 _ramOptimizer . EmptyWorkingSetFunction ( exceptionsList ) ;
193- _ramOptimizer . ClearFileSystemCache ( filesystemcache ) ;
203+
204+ if ( ClearFileSystemCache )
205+ {
206+ _ramOptimizer . ClearFileSystemCache ( ClearStandbyCache ) ;
207+ }
194208
195209 await Task . Delay ( 10000 ) ;
196210
0 commit comments