Hi ,
We have recently migrated from VB6 application to VB.NET 3.5 and contains lots of forms.
As I open form memory increases and after closing the form it remains the same. So after some time the memory goes on increasing and app becomes very slow. Memory Profiler showed many from controls like ToolStripDropDownMenu ,GroupBox andSaveFileDialog in Top Objects in the Finalizer Queue.
How to clear this queue or is there any way to force free the memory held by form objects.
Code :
Private Sub frm_Test_Closed(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles MyBase.Closed Try GC.Collect() GC.WaitForPendingFinalizers() GC.SuppressFinalize(Me) Me.Dispose() Catch ex As Exception InEventViewer.LogError(ErrorConstants.THRUST_ERROR_032, ex) End Try End Sub
Top Objects in the Finalizer queue
System.Windows.Forms.PictureBox System.Windows.Forms.ToolStripDropDownMenu System.Windows.Forms.GroupBox System.Windows.Forms.ToolStripScrollButton System.Windows.Forms.Internal.WindowsGraphics System.Windows.Forms.ToolStripScrollButton+StickyLabel System.Windows.Forms.TabPage System.Drawing.Graphics System.Drawing.Font System.Windows.Forms.ToolStripGrip System.Windows.Forms.Internal.WindowsFont System.Windows.Forms.Internal.WindowsPen System.Drawing.Drawing2D.Matrix System.Drawing.Region System.Windows.Forms.PaintEventArgs System.Windows.Forms.Control+FontHandleWrapper System.Windows.Forms.ContextMenuStrip System.Windows.Forms.Internal.WindowsRegion System.Windows.Forms.Internal.WindowsSolidBrush System.Windows.Forms.ToolStripButton System.Windows.Forms.TabControl System.Drawing.BufferedGraphics System.Drawing.FontFamily System.Windows.Forms.ToolTip System.Drawing.Bitmap System.Windows.Forms.AxHost+ConnectionPointCookie System.Drawing.Pen System.Windows.Forms.AxHost+OleInterfaces System.Windows.Forms.OpenFileDialog System.Windows.Forms.SaveFileDialog
Thanks
Raju