the886 发表于 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

xsjtxy 发表于 2010-8-1 13:51:39

最好把你代码全部发出来。

xsjtxy 发表于 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

the886 发表于 2010-8-1 16:35:53

回复 3# xsjtxy


    谢谢~
页: [1]
查看完整版本: 请问内存使用量每次增一点,无限增大,怎么解决