delphi 获得当前进程所使用的内存


本文整理自网络,侵删。

 //delphi 获得当前进程所使用的内存

uses PsAPI ...

//current memory size of the current process in bytes
function CurrentMemoryUsage: Cardinal;
var
pmc: TProcessMemoryCounters;
begin
pmc.cb := SizeOf(pmc) ;
if GetProcessMemoryInfo(GetCurrentProcess, @pmc, SizeOf(pmc)) then
Result := pmc.WorkingSetSize
else
RaiseLastOSError;
end;

To display the memory usage in KB, use:
ShowMessage(FormatFloat('Memory used: ,.# K', CurrentMemoryUsage / 1024)) ;

相关阅读 >>

Delphi获取网卡mac地址的两种方法

Delphi读写utf-8、unicode格式文本文件

Delphi windows 编程[1] - 窗体生成的过程一

Delphi打开"我的电脑"等特殊文件夹

Delphi获取本机的ip地址

Delphi firedac 下的 sqlite [8] - 自定义函数

Delphi 检测用户超过多长时间没有操作键盘或鼠标

Delphi idhttp1 xmlpost

Delphi 动态创建窗体

Delphi 获取指定当前目录下指定文件扩展名所有文件

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...