this slowpoke moves

Clear Memory

Beispiel 1 :
procedure DSiTrimWorkingSet;
var
  hProcess: THandle;
begin
  hProcess := OpenProcess(PROCESS_SET_QUOTA, false, GetCurrentProcessId);
  try
    SetProcessWorkingSetSize(hProcess, $FFFFFFFF, $FFFFFFFF);
  finally CloseHandle(hProcess); end;
end; { DSiTrimWorkingSet }

procedure BitBtn1Click(Sender: TObject);
begin
  DSiTrimWorkingSet;
end;
Beispiel 2 :
procedure TForm1.Button1Click(Sender: TObject);
var
  Buffer     : array of Byte;
begin
  SetLength(Buffer, 32768);
  ZeroMemory(@Buffer[0], sizeof(Buffer));
end;
Beispiel 3 :
procedure TForm1.Button1Click(Sender: TObject);
var
  Buffer     : array of Byte;
  counter    : Integer;
begin
  SetLength(Buffer, 32768);
  for counter := Low(Buffer) to High(Buffer) do
    Buffer[counter] := 0;
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate