﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
520	WMI SwbemRefresher Object used in a loop has memory leak	PsaltyDS		"Ref:  Example Scripts, _ProcessListProperties() function [http://www.autoitscript.com/forum/index.php?showtopic=70538]

The _ProcessListProperties() function uses an SwbemRefresher object to get performance data for processes (CPU and MEM usage).  If the function is called in a loop, there is a bad memory leak (monitored from Task Manager):  

{{{HotKeySet(""{ESC}"", ""_Quit"")

; Loop to watch for memory leak
While 1
	_ProcessListProperties()
	Sleep(500)
WEnd

Func _Quit()
	Exit
EndFunc   ;==>_Quit
}}}

Moving the creation of the SwbemRefresher outside the function (and loop) so it is only created once, makes the leak go away.  (See topic post for code) [http://www.autoitscript.com/forum/index.php?s=&showtopic=70538&view=findpost&p=566344]

Removing all items and then releasing the object with $oRefresher.DeleteAll and $oRefresher = 0 does not change the memory leak."	Bug	closed		AutoIt	3.2.12.1	None	No Bug	WMI SwbemRefresher	
