找回密码
 加入
搜索
查看: 1642|回复: 3

[AU3基础] 请问内存使用量每次增一点,无限增大,怎么解决

[复制链接]
发表于 2010-8-1 13:42:07 | 显示全部楼层 |阅读模式
本帖最后由 the886 于 2010-8-1 14:08 编辑

我做了一个循环刷新如下

GUICtrlCreateListViewItem("111|222", $ListView1)
GUICtrlSetImage(-1, "shell32.dll", 11, 0)

使用GUICtrlSetImage(-1, "shell32.dll", 11, 0)  的时候,内存使用量每运行一次增一点,无限增大

使用 _ReduceMemory(@AutoItPID) 也不能“真正”释放内存

比如下面,sleep(100)只是为了快一点表现出来,内存每一次加一点点,几分种后就不得了了
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 294, 255, 192, 114)
$ListView1 = GUICtrlCreateListView("111|222", 8, 16, 265, 209)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        _GUICtrlListView_DeleteAllItems($ListView1)
        GUICtrlCreateListViewItem("111|222", $ListView1)
        GUICtrlSetImage(-1, "shell32.dll", 11, 0)
        Sleep(100)
WEnd
发表于 2010-8-1 13:51:39 | 显示全部楼层
最好把你代码全部发出来。
发表于 2010-8-1 15:01:47 | 显示全部楼层
这样就不会了
#include <GUIConstantsEx.au3>

#include <ListViewConstants.au3>

#include <WindowsConstants.au3>

#include <GuiConstantsEx.au3>

#include <GuiListView.au3>
$Form1 = GUICreate("Form1", 294, 255, 192, 114)
GUISetState(@SW_SHOW)

While 1
$ListView1 = GUICtrlCreateListView("111|222", 8, 16, 265, 209)
GUICtrlCreateListViewItem("111|222", $ListView1)
GUICtrlSetImage(-1, "shell32.dll", 11, 0)
sleep(100)
GUICtrlDelete($ListView1)
WEnd

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

 楼主| 发表于 2010-8-1 16:35:53 | 显示全部楼层
回复 3# xsjtxy


    谢谢~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 00:58 , Processed in 0.070924 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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