New Tip - ...get the used memory for a process ?

  • From: "SwissDelphiCenter.ch" <webmaster@xxxxxxxxxxxxxxxxxxxx>
  • To: sdcnewtip@xxxxxxxxxxxxx
  • Date: Sun, 3 Feb 2002 17:51:50 +0100

* SwissDelphiCenter new Tip newsletter
* www.swissdelphicenter.ch
*
* To unsubscribe send a mail to sdcnewtip-request@xxxxxxxxxxxxx with the
* subject unsubscribe


Hallo,

Folgender neuer Tip ist neu auf SwissDelphiCenter verfügbar:

Besuchen Sie die Programmier Tips unter 
http://www.swissdelphicenter.ch/de/tipsindex.php


Bewerten Sie diesen Tip nach Schwierigkeitsgrad, Nützlichkeit und Gesamthaft auf
http://www.swissdelphicenter.ch/de/showcode.php?id=1010



Autor:
Evgeny V. Levashov <eugene@xxxxxxxxxxxxxxxxxxx>



-------------
...den gebrauchten Speicher eines Prozesses auslesen ?
-------------
Kategorie: System



// Works only on Windows NT systems (WinNT, Win2000, WinXP)

// Funktioniert nur unter Windows NT Systemen (WinNT, Win2000, WinXP)

uses psAPI;

procedure TForm1.Button1Click(Sender: TObject);
var
  pmc: PPROCESS_MEMORY_COUNTERS;
  cb: Integer;
begin
  cb := SizeOf(_PROCESS_MEMORY_COUNTERS);
  GetMem(pmc, cb);
  pmc^.cb := cb;
  if GetProcessMemoryInfo(GetCurrentProcess(), pmc, cb) then
    Label1.Caption := IntToStr(pmc^.WorkingSetSize) + ' Bytes'
  else
    Label1.Caption := 'Unable to retrieve memory usage structure';

  FreeMem(pmc);
end;




Best Regards
SwissDelphiCenter Team
www.swissdelphicenter.ch
[automatisch generierte EMail]


----------------------------------------------------
ENGLISH NEWSLETTER
----------------------------------------------------

Hi,

This new tip is new available on SwissDelphiCenter.ch:

Visit the programming tips at http://www.swissdelphicenter.ch/en/tipsindex.php


Rate this tip after skill, useful and overall at
http://www.swissdelphicenter.ch/en/showcode.php?id=1010



Author:
Evgeny V. Levashov <eugene@xxxxxxxxxxxxxxxxxxx>



-------------
...get the used memory for a process ?
-------------
Category: System



// Works only on Windows NT systems (WinNT, Win2000, WinXP)

// Funktioniert nur unter Windows NT Systemen (WinNT, Win2000, WinXP)

uses psAPI;

procedure TForm1.Button1Click(Sender: TObject);
var
  pmc: PPROCESS_MEMORY_COUNTERS;
  cb: Integer;
begin
  cb := SizeOf(_PROCESS_MEMORY_COUNTERS);
  GetMem(pmc, cb);
  pmc^.cb := cb;
  if GetProcessMemoryInfo(GetCurrentProcess(), pmc, cb) then
    Label1.Caption := IntToStr(pmc^.WorkingSetSize) + ' Bytes'
  else
    Label1.Caption := 'Unable to retrieve memory usage structure';

  FreeMem(pmc);
end;



Best Regards
SwissDelphiCenter Team
www.swissdelphicenter.ch
[automatic generated EMail]

Other related posts:

  • » New Tip - ...get the used memory for a process ?