VB.NET ejecución de comandos y problema de falta de recursos

axxegfx
12 de Octubre del 2005
Estoy teniendo problemas con la falta de recursos de mi programa despues de un buen rato de ejecución en un bucle, acaba por darme el error "Additional information: Recursos insuficientes en el sistema para completar el servicio solicitado"

Es un problema de falta de recursos claros.

Os anexo uno de los hilos

Public Function Count1(ByVal iterations As Long) As Long
Dim objInfoProc As New ProcessStartInfo
Dim reg As Regex
Dim response As String = ""
Dim amatch As Match
Dim blnDomTrouv As Boolean = False
Dim i As Integer
Dim t As Thread = Thread.CurrentThread

Dim sr As System.IO.StreamReader
For i = 1 To iterations
Dim objProcess As System.Diagnostics.Process
objProcess = New System.Diagnostics.Process
objProcess.StartInfo.FileName = "nslookup.exe"
objProcess.StartInfo.UseShellExecute = False
objProcess.StartInfo.RedirectStandardOutput = True
objProcess.StartInfo.CreateNoWindow = True
objProcess.StartInfo.Arguments = " -querytype=any " & dominio(i) & ".com"
objProcess.Start()
sr = objProcess.StandardOutput
objProcess.WaitForExit()
objProcess.Close()
reg = New Regex("nameserver = (?<server>[^\s]+)")
Do While (sr.Peek() > -1)
response = sr.ReadLine()
amatch = reg.Match(response)
If (amatch.Success) Then
pinga(i) = "X"
Exit Do
End If
Loop
objProcess.Dispose()
objProcess.Close()
objProcess = Nothing
reg = Nothing
Me.txtDisplay.Invoke(New ChangeTextControlDelegate(AddressOf SetDisplayText), New Object() {t.Name, txtDisplay, i.ToString, 1})
Next
Me.txtDisplay.Invoke(New ChangeTextControlDelegate(AddressOf SetDisplayText), New Object() {t.Name, txtDisplay, i.ToString, -9})
Return i
End Function

¿ alguna idea ?