get the total and available memory?

Author: Simon Grossenbacher 

Homepage: http://www.swissdelphicenter.ch

1 Comment to this tip [Write new comment]

[ Print tip ]    

 

Tip Rating (10):  

Skill:  

Useful:  

Overall:  

 

 

 

procedure TForm1.Button1Click(Sender: TObject);

var

  memory: TMemoryStatus;

begin

  memory.dwLength := SizeOf(memory);

  GlobalMemoryStatus(memory);

  ShowMessage('Total Arbeitsspeicher/Total memory: ' +

              IntToStr(memory.dwTotalPhys) + ' Bytes');

  ShowMessage('Freier Arbeitsspeicher/Available memory: ' +

              IntToStr(memory.dwAvailPhys) + ' Bytes');

end;

 

 

INNE:

 

var

  MemoryStatus : TMemoryStatus;

 

 

procedure TForm1.memoryClick(Sender: TObject);

begin

 MemoryStatus.dwLength := SizeOf(MemoryStatus);

GlobalMemoryStatus(MemoryStatus);

With MemoryStatus do

Begin

dwTotalPhys := dwTotalPhys DIV 1024;

Label2.Caption := 'Memory load : ' + IntToStr(dwMemoryLoad);

Label3.Caption := 'Total phys : ' + IntToStr(dwTotalPhys);

Label4.Caption := 'Avail phys : ' + IntToStr(dwAvailPhys);

Label5.Caption := 'Total Page File : ' + IntToStr(dwTotalPageFile);

Label6.Caption := 'Avail Page File : ' + IntToStr(dwAvailPageFile);

Label7.Caption := 'Total Virtual : ' + IntToStr(dwTotalVirtual);

Label8.Caption := 'Avail Virtual : ' + IntToStr(dwAvailVirtual);

End;

end;