Autor Beitrag
Larus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Do 03.02.05 11:12 
Also... Wie kann mein Programm herausfinden wie viel Ram ich habe. Ich will ein Tool schaffen mit dem ich sowohl die Gesamtmenge an Ram in MB anzeigen kann... die der jeweilige rechner a´hat und ich muss rausfinden wieviel von dieser Menge belegt ist.

Wie geht das.. wenn Möglich mit Code samples
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 03.02.05 11:36 
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Do 03.02.05 22:06 
Wo find ich das denn für delphi net für C++ oder C
Elite
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 03.02.05 22:12 
Um mal ein paar Funktionen von Luckie aus einem anderen Thread hier aufzuführen:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
function GetTotalMemory: Int64;
var
   Memory : TMemoryStatus;
begin
     Memory.dwLength := SizeOf(Memory);
     GlobalMemoryStatus(Memory);
     Result := Memory.dwTotalPhys;
end;

function GetAvailMemory: Int64;
var
   Memory : TMemoryStatus;
begin
     Memory.dwLength := SizeOf(Memory);
     GlobalMemoryStatus(Memory);
     Result := Memory.dwAvailPhys;
end;

function GetTotalPageFile: Int64;
var
   Memory : TMemoryStatus;
begin
     Memory.dwLength := SizeOf(Memory);
     GlobalMemoryStatus(Memory);
     Result := Memory.dwTotalPageFile;
end;

function GetAvailPageFile: Int64;
var
   Memory : TMemoryStatus;
begin
     Memory.dwLength := SizeOf(Memory);
     GlobalMemoryStatus(Memory);
     Result := Memory.dwAvailPageFile;
end;

function GetUsedMemory: Int64;
var
   Memory : TMemoryStatus;
begin
     Memory.dwLength := SizeOf(Memory);
     GlobalMemoryStatus(Memory);
     Result := Memory.dwMemoryLoad;
end;
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Sa 05.02.05 23:46 
Wenn du mehrere Werte auf einmal haben willst, solltest du GlobalMemoryStatus(Memory); nur einmal ausführen und dann mit den Informationen zu arbeiten - das müsste ein wenig Zeit sparen und ist sauberer!

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Do 10.02.05 18:27 
Titel: Und wie leert man x MB Ram
So und nun die Frage wie man eine bestimmte Menge Ram leeren kann...
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 10.02.05 18:29 
Titel: Re: Und wie leert man x MB Ram
Larus hat folgendes geschrieben:
So und nun die Frage wie man eine bestimmte Menge Ram leeren kann...


So, und nun einen neuen Thread für eine neue Frage ;)

AXMD
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Do 10.02.05 18:50 
Titel: Och lol
Mist man kann es ja versuchen lol
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 28

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 10.02.05 18:58 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Button1Click(Sender: TObject);
var
  Memory: TMemoryStatus;
begin
  Memory.dwLength := SizeOf(Memory);
  GlobalMemoryStatus(Memory);

  //Arbeitsspeicher
  Label1.Caption:=IntToStr(Memory.dwTotalPhys div 1024);
  //Freier Arbeitsspeicher
  Label2.Caption:=IntToStr(Memory.dwAvailPhys div 1024);
  //Größte Größe der Auslagerungsdatei
  Label3.Caption:=IntToStr(Memory.dwTotalPageFile div 1024);
  //Freier Platz der Auslagerungsdatei
  Label4.Caption:=IntToStr(Memory.dwAvailPageFile div 1024);
end;
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Sa 12.02.05 20:23 
Titel: Danke
Besten Dank....