Ga naar inhoud

[Delphi] Geheugen beschikbaar voor Windows:


anoniem

Aanbevolen berichten

[quote:8d6b900161="Johan Stokking"]Hoe kan je opvragen hoeveel geheugen er beschikbaar is voor Windows? Is vast niet zo heel moeilijk...[/quote:8d6b900161] [i:8d6b900161]Geheugen[/i:8d6b900161] is nogal een ruim begrip. Bedoel je fysiek geheugen, virtueel geheugen, harde schijf/swapfile, etc. [code:1:8d6b900161] var memStatus: TMemoryStatus; begin memStatus.dwLength := SizeOf(memStatus); GlobalMemoryStatus(memStatus); ShowMessage('Memory load: ' + IntToStr(memStatus.dwMemoryLoad) + '%'); ShowMessage('Physical memory: ' + IntToStr(memStatus.dwTotalPhys)); ShowMessage('Available memory: ' + IntToStr(memStatus.dwAvailPhys)); ShowMessage('Physical store size: ' + IntToStr(memStatus.dwTotalPageFile)); ShowMessage('Available page size: ' + IntToStr(memStatus.dwAvailPageSize)); ShowMessage('Physical virtual memory: ' + IntToStr(memStatus.dwTotalVirtual)); ShowMessage('Available virtual memory: ' + IntToStr(memStatus.dwAvailVirtual)); end; [/code:1:8d6b900161] [i:8d6b900161]"The usefulness of calling the GlobalMemoryStatus function is to determine how much memory it can allocate without severely impacting other applications. By periodically getting the current memory status, you can determine whether the machine is running low on available resources. This can be very beneficial as the operating system, or your application, may have problems when there are limited resources, particularly if your application is real-time or time critical."[/i:8d6b900161] [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/globalmemorystatus.asp]MSDN - GlobalMemoryStatus[/url] [url=http://msdn.microsoft.com/isapi/gosupport.asp?TARGET=/support/kb/articles/Q274/5/58.asp?SD=MSDN&FR=0]GlobalMemoryStatus() Function Behavior on Systems with More than 2 GB RAM[/url]
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

×
×
  • Nieuwe aanmaken...