Visual basic memory usage and unloading forms
Posted on 2004-03-27
I'm working in VB6.0, and have two forms, the first one has a button and the second a crystal reports 8.5 viewer. Clicking a button one the first form launches the second one which displays a crystal report.
Using the windows task manager I'm monitoring the memory use of the compiled application and when it starts the mem usage is around 1,900K and then when I click the button to launch the second form it shoots up to about 14,000K, but when I closed down the second form it stays at 12,000K. Surely when that second form is closed it should drop down to a level similar to its starting point?
Am I missing something here? Any help would be greatful. Sourcecode below.
Form1 > references > Crystal Report Viewer control & Crystal Reports Activex 8.5 Designer run time library
Private Sub Command1_Click()
Set crystal = New CRAXDRT.Application
Set Report = crystal.OpenReport(App.Path & "\" & "test.rpt")
Form2.CRViewer1.ReportSource = Report
Form2.Visible = True
Private Sub Form_Unload(Cancel As Integer)
Set crystal = Nothing
Set Report = Nothing