Autor Beitrag
holgerbremen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120



BeitragVerfasst: Do 07.12.06 10:18 
Wie bzw. mit welchen Funktionen kann man die Speicherauslastung und den verbrauchten virtuellen Speicher der Anwendung eigentlich bestimmen, eben die Informationen, die der Taskmanager auch anzeigt.

Gruß
Hoger
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Do 07.12.06 10:50 
(1) die Suche hier benutzen
(2)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
{--------------------}
{ liest RAM-Info aus }
{--------------------}
function ReadMemory: TMemoryStatus;
begin
  Result.dwLength := SizeOf(Result);
  GlobalMemoryStatus(Result);
end;

(3) TMemoryStatus + F1

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
holgerbremen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120



BeitragVerfasst: Do 07.12.06 11:07 
Danke für die Antwort, das suchte ich.

Wenn man das richtige Stichwort hat, ist die Suche leicht :)
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 07.12.06 12:09 
Folgendes ist aus einer DLL, die ich vor einigen Tagen für SAMURIZE geschrieben habe - kann man für andere Zwecke vereinfachen:

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:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
function AddThouSeps (const S: string): string;
var
    LS, L2, I : Integer;
    Temp : string;
begin
    result := S ;
    LS := Length (S);
    if LS <= 3 then exit ;
    L2 := (LS - 1div 3;
    Temp := '';
    for I := 1 to L2 do
            Temp := ThousandSeparator + Copy (S, LS - 3 * I + 13) + Temp;
    Result := Copy (S, 1, (LS - 1mod 3 + 1) + Temp;
end;
Function MemoryLoad (func: PChar):PChar;stdcall;export;
var Memory: TMemoryStatus;
begin
 Memory.dwLength := SizeOf(Memory);
 GlobalMemoryStatus(Memory);
result:=PChar(IntToStr(Memory.dwMemoryLoad)+' %');
end;
Function Ramfree (func: PChar):PChar;stdcall;export;
var Memory: TMemoryStatus;
begin
 Memory.dwLength := SizeOf(Memory);
 GlobalMemoryStatus(Memory);
result:=PChar(AddThouSeps(IntToStr(Memory.dwAvailPhys div 1024))+' KB');
end;
Function Ramtotal (func: PChar):PChar;stdcall;export;
var Memory: TMemoryStatus;
begin
 Memory.dwLength := SizeOf(Memory);
 GlobalMemoryStatus(Memory);
result:=PChar(AddThouSeps(IntToStr(Memory.dwTotalPhys div 1024))+' KB');
end;
Function Pagefilefree (func: PChar):PChar;stdcall;export;
var Memory: TMemoryStatus;
begin
 Memory.dwLength := SizeOf(Memory);
 GlobalMemoryStatus(Memory);
result:=PChar(AddThouSeps(IntToStr(Memory.dwAvailPageFile div 1024))+' KB');
end;
Function Pagefiletotal (func: PChar):PChar;stdcall;export;
var Memory: TMemoryStatus;
begin
 Memory.dwLength := SizeOf(Memory);
 GlobalMemoryStatus(Memory);
result:=PChar(AddThouSeps(IntToStr(Memory.dwTotalPageFile div 1024))+' KB');
end;
Function Virtualtotal (func: PChar):PChar;stdcall;export;
var Memory: TMemoryStatus;
begin
 Memory.dwLength := SizeOf(Memory);
 GlobalMemoryStatus(Memory);
result:=PChar(AddThouSeps(IntToStr(Memory.dwTotalVirtual div 1024))+' KB');
end;
Function Virtualfree (func: PChar):PChar;stdcall;export;
var Memory: TMemoryStatus;
begin
 Memory.dwLength := SizeOf(Memory);
 GlobalMemoryStatus(Memory);
result:=PChar(AddThouSeps(IntToStr(Memory.dwAvailVirtual div 1024))+' KB');
end;