RequestFullClean([MaxDuration: Integer = -1]);
RequestFullClean(MaxDuration: Integer);
MaxDuration. Garbage collection time in seconds.
The RequestFullClean method starts a full cycle of garbage collection.
Unlike the RequestPartitialClean method that executes only one iteration of garbage collection, RequestFullClean will repeat memory cleaning until all non-used objects are deleted. For example, there is an object B that depends on an object A. The object A is marked as a non-used one. After executing the RequestPartitialClean method the object A is deleted from memory, and the object B is kept. Executing the RequestFullClean method deletes the object A after the first iteration, the object B is deleted after the second iteration, and so on.
The MaxDuration parameter is not set by default; garbage is collected until memory contains only the objects that are marked as used ones. If the MaxDuration parameter is set, and the garbage collector does not manage to finish its work in the specified time, the process is paused and resumed on repeated calling of the method, or under the conditions required for automatic startup of garbage collection.
Sub UserProc;
Var
GC: IForeGarbageCollector;
Begin
GC := New ForeGarbageCollector.Create;
GC.RequestFullClean(1);
End Sub UserProc;
Executing the example starts a full cycle of garbage collection. Garbage collection will last one second.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Fore;
Public Shared Sub Main(Params: StartParams);
Var
Svc: IForeServices;
Run: IForeRuntime;
Begin
Svc := Params.Metabase As IForeServices;
Run := Svc.GetRuntime();
Run.RequestFullClean(1);
End Sub;
See also: