Looking at the tutorial is not helpful since it doesn't even come close to what I have. Any way I could upload log file (or the asp.net source files) and someone could give some kind of pointers?
Code: Select all
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim objContext As HttpContext = HttpContext.Current Dim objDS As DataSet = CType(objContext.Cache("Testing123"), DataSet) If objDS Is Nothing Then Using objDb As New DbUtils() Dim strSQL As String = "SELECT * FROM v2_article art INNER JOIN v2_Item itm ON art.item_id=itm.item_id WHERE active = 1 AND start_date > '1/1/2005' ORDER BY start_date desc" objDS = objDb.GetDataSet(strSQL, False) End Using End If For Each objRow As DataRow In objDS.Tables(0).Rows Response.Write(objRow("Headline").ToString) Response.Write("<br/>") Response.Write(objRow("start_date").ToString) Response.Write("<br/><br/>") Next End Sub
Code: Select all
Imports Microsoft.VisualBasic Imports System.Data.SqlClient Imports System.Data Public Class DbUtils Implements IDisposable Private objConn As SqlConnection Private strConnectionString As String = "" Public Sub New() strConnectionString = "server=SQL_ServerName;UID=UserID;PWD=Password;DATABASE=am;pooling=true" objConn = New SqlConnection(strConnectionString) objConn.Open() End Sub Public Function GetDataSet(ByVal strSQL As String, ByVal booIsStoredProc As Boolean) As DataSet Dim objAdapter As SqlDataAdapter Dim objCommand As SqlCommand Dim objDataSet As DataSet objCommand = New SqlCommand(strSQL, objConn) objCommand.CommandTimeout = 3000 If booIsStoredProc Then objCommand.CommandType = Data.CommandType.StoredProcedure Else objCommand.CommandType = Data.CommandType.Text End If objAdapter = New SqlDataAdapter(objCommand) objDataSet = New Data.DataSet objAdapter.Fill(objDataSet, "DataSet") objCommand.Dispose() objAdapter.Dispose() Return objDataSet End Function #Region "IDisposable Support" Private disposedValue As Boolean = False ' To detect redundant calls ' IDisposable Protected Overridable Sub Dispose(booDisposing As Boolean) If booDisposing Then Try objConn.Close() objConn = Nothing Catch ex As Exception Throw ex End Try End If End Sub ' TODO: override Finalize() only if Dispose(ByVal disposing As Boolean) above has code to free unmanaged resources. Protected Overrides Sub Finalize() ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. Dispose(False) MyBase.Finalize() End Sub ' This code added by Visual Basic to correctly implement the disposable pattern. Public Sub Dispose() Implements IDisposable.Dispose ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub #End Region End Class
So, with this code, the output from the memory profiler (using the WebDev.WebServer Version 4) makes no sense: seems to have a bunch of memory leaks, but I can't figure out how to see what they are. Some of the concepts are just not making sense yet.
I run the asp page and take a snapshot.
Then I run it again (F5 on webpage) and take another snapshot.
Then I change the dropdown in the "Types" windows to "With additional instances (delta >0)" and I have about 25 lines all with the ".net" image in the 1st column.
The 1st line is "System" "Styring" with 6003 total, 74 new, 21 removed, delta 53, total 465574, etc....
If I double click on this, Allocation stacks is 1 of 1062. Sorting by the instance column and double clicking brings up the "Type Instance Details" where the instance graph is. Makes no sense to me... Not sure what any of it means.
Where should I be looking for memory leaks? What should I be looking for? What does it mean?
Unfortunately, the documentation has not been updated for version 4.0 of the profiler, but you can get some imformation about the instance graph on the preview page.
SciTech Software AB
Users browsing this forum: No registered users and 29 guests