The script I'm running is like reads a list of users from an inputfile and gather some account information.
Even tried assigning $objUser=0 but the memory usage keeps growing.
Here is some example code of what I'm doing:
$file = FileOpen("input.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $objUser=ObjGet("LDAP://CN=" & $line & ",DC=Fabrikam,DC=Com") ; Reads some user properties $objUser=0 Wend FileClose($file)
In each loop iteration, the memory keeps growing. For a list of 20000 users, this is really a problem!
The script reached about 450MB of memory usage.
The same thing happens when not using an inputfile and getting the users list from an AD query.
A workaround I've found was to create another script, which creates the user object and reads the user information, and in each loop iteration, call this script. Doing this, when the called script is terminated, the memory is released, but this method is much slower, as a new process is created for each user.
Maybe I'm missing some function or method to release the memory, but assigning the variable to 0 is the only method I've found in the forums and documentation.
Hope someone can help me.
Thank You,
Leandro





