GetMemoryStatus: IMemoryStatus;
The GetMemoryStatus method returns information about physical and virtual computer memory.
Add a link to the Host system assembly.
Sub UserProc;
Var
App: IApplication;
MemStat: IMemoryStatus;
Begin
App := Application.Instance;
MemStat := App.GetMemoryStatus;
Debug.WriteLine("Physical memory amount: " + (MemStat.TotalPhysicalMemory / 1048576).ToString + " Mb");
Debug.WriteLine("Virtual memory amount: " + (MemStat.TotalVirtualMemory / 1048576).ToString + " Mb");
Debug.WriteLine("Maximum size of swap file: " + (MemStat.TotalPageFile / 1048576).ToString + " Mb");
Debug.WriteLine("Available physical memory: " + (MemStat.AvailablePhysicalMemory / 1048576).ToString + " Mb");
Debug.WriteLine("Available virtual memory: " + (MemStat.AvailableVirtualMemory / 1048576).ToString + " Mb");
Debug.WriteLine("Available size of swap file: " + (MemStat.AvailablePageFile / 1048576).ToString + " Mb");
Debug.WriteLine("Memory load percentage: " + MemStat.MemoryLoad.ToString + " %");
End Sub UserProc;
After executing the example the development environment console displays information about the available operating system memory.
See also: