I have a small issue.
Playing with VisualVM and create a heapdump, I see the resultset is not clean by GC even after closing.
Memory usage go slow up.
Null the Resultset is helping some but I think this is not the way to do it.
Any idea about this?
Playing with VisualVM and create a heapdump, I see the resultset is not clean by GC even after closing.
Memory usage go slow up.
Null the Resultset is helping some but I think this is not the way to do it.
Any idea about this?
Using Resultset:
Sample Sub
Private Sub StartQuery(strMYSQL As String, Task As Int)
Try
strMYSQL = strMYSQL.Trim
Dim strSelectPart As String = "SELECT " & Task & " AS QueryID, "
If strMYSQL.Contains("SELECT") Then
strMYSQL = strMYSQL.SubString("SELECT".Length + 1)
strMYSQL = strSelectPart & strMYSQL
' strMYSQL = strMYSQL.Replace("SELECT", "SELECT " & Task & " AS QueryID, ")
End If
If strMYSQL.Contains("COUNT") = False And strMYSQL.Contains("SELECT") = True Then
Functions.LastQuery = strMYSQL 'Check for Select Query
End If
If Functions.SQLASYNC.IsInitialized = False Then
Functions.ConnectToSQLASYNC
End If
'***********************************************************************************
Functions.WriteQUERYLog("In startQuery " & CRLF & strMYSQL)
' Functions.SQLASYNC.ExecQueryAsync("SQLLOG", strMYSQL, Null)
Dim SenderFilter As Object = Functions.SQLASYNC.ExecQueryAsync("SQLTMP", strMYSQL, Null)
Wait For (SenderFilter) SQLTMP_QueryComplete (Success As Boolean, RS As ResultSet)
If Success = True Then
Wait For (SQLLOG_End(Success, RS)) Complete (Retvalue As Boolean)
Else
Log(LastException)
End If
'***********************************************************************************
Catch
' lblMess.Text = "Last error in StartQuery " & LastException.Message
Functions.ShowLog("Last error in StartQuery Main", True, False, LastException.Message)
End Try
If RS.IsInitialized = True Then
RS.Close
RS = Null
End If
'****************************************************
If Functions.SQLASYNC.IsInitialized = True Then
Functions.SQLASYNC.Close
End If
End Sub