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 高亮选中memo某一行

Delphi 获取网址链接协议头

Delphi 远程屏幕抓取的源代码

Delphi hmac256

Delphi xe 控件字体加粗变色居中等

Delphi 访问https图片

Delphi中操作powerpoint幻灯片的示例代码

Delphi 获取网页源代码的最简单办法

Delphi issameday、istoday - 判断是不是同一天、判断是不是今天

Delphi递归删除列表文件以外的所有文件

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



打赏

取消

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

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

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

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

评论

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