找回密码
 加入
搜索
查看: 2163|回复: 6

au3写出来的脚本能减小内存使用率么?

[复制链接]
发表于 2008-10-13 10:33:31 | 显示全部楼层 |阅读模式
就5、6行代码,可是内存使用率就4000k-6000k,也太夸张了吧,有没有什么办法能够减少内存使用率呢

[ 本帖最后由 wbsgege 于 2008-10-14 11:55 编辑 ]
发表于 2008-10-13 10:47:18 | 显示全部楼层
代码贴出来
发表于 2008-10-13 12:35:02 | 显示全部楼层
au3肯定别别的语言写的程序要占的大
发表于 2008-10-13 14:25:56 | 显示全部楼层
未编译的脚本内存占用很大是正常的
发表于 2008-10-13 14:50:04 | 显示全部楼层
AutoIT 本来就是占的多一点!


_ReduceMemory(@AutoItPID)
Func _ReduceMemory($i_PID = -1)
    If $i_PID <> -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf

    Return $ai_Return[0]
EndFunc   ;==>_ReduceMemory
发表于 2008-10-14 09:49:02 | 显示全部楼层
原帖由 liongodmien 于 2008-10-13 14:50 发表
AutoIT 本来就是占的多一点!

[au3]
_ReduceMemory(@AutoItPID)
Func _ReduceMemory($i_PID = -1)
    If $i_PID  -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', ...



这个只是看上去很美,把物理内存写到虚拟内存中了……
发表于 2010-4-11 07:58:10 | 显示全部楼层
厉害。。。。。。。。。厉害
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-3 04:32 , Processed in 0.073377 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表