GetMemoryStatus: IMemoryStatus;
GetMemoryStatus(): Prognoz.Platform.Interop.Ui.IMemoryStatus;
The GetMemoryStatus property returns information on physical and virtual computer memory.
Sub UserProc;
Var
WinApp: IWinApplication;
MemStat: IMemoryStatus;
Begin
WinApp := WinApplication.Instance;
MemStat := WinApp.GetMemoryStatus;
Debug.WriteLine("Physical memory size: " + (MemStat.TotalPhysicalMemory / 1048576).ToString + " Mb");
Debug.WriteLine("Virtual memory size: " + (MemStat.TotalVirtualMemory / 1048576).ToString + " Mb");
Debug.WriteLine("Maximum size of swap file: " + (MemStat.TotalPageFile / 1048576).ToString + " Mb");
Debug.WriteLine("Free physical memory: " + (MemStat.AvailablePhysicalMemory / 1048576).ToString + " Mb");
Debug.WriteLine("Free virtual memory: " + (MemStat.AvailableVirtualMemory / 1048576).ToString + " Mb");
Debug.WriteLine("Available size of swap file: " + (MemStat.AvailablePageFile / 1048576).ToString + " Mb");
Debug.WriteLine("Memory load percent: " + MemStat.MemoryLoad.ToString + " %");
End Sub UserProc;
On executing the example the console window displays information on the memory available in the operating system.
Imports Prognoz.Platform.Interop.Ui;
Sub UserProc();
Var
WinApp: WinApplication = New WinApplicationClass_2();
MemStat: IMemoryStatus;
Begin
MemStat := WinApp.GetMemoryStatus();
System.Diagnostics.Debug.WriteLine("Physical memory size: " + (MemStat.TotalPhysicalMemory / 1048576).ToString() + " Mb");
System.Diagnostics.Debug.WriteLine("Virtual memory size: " + (MemStat.TotalVirtualMemory / 1048576).ToString() + " Mb");
System.Diagnostics.Debug.WriteLine("Maximum size of swap file: " + (MemStat.TotalPageFile / 1048576).ToString() + " Mb");
System.Diagnostics.Debug.WriteLine("Free physical memory: " + (MemStat.AvailablePhysicalMemory / 1048576).ToString() + " Mb");
System.Diagnostics.Debug.WriteLine("Free virtual memory: " + (MemStat.AvailableVirtualMemory / 1048576).ToString() + " Mb");
System.Diagnostics.Debug.WriteLine("Available size of swap file: " + (MemStat.AvailablePageFile / 1048576).ToString() + " Mb");
System.Diagnostics.Debug.WriteLine("Memory load percent: " + MemStat.MemoryLoad.ToString() + " %");
End Sub;
On executing the example the console window displays information on the memory available in the operating system.
See also: