S
Simon Verona
I have a problem in my application which I believe is due to open handles.. .
The symptom that users report is that after they have been using the application for a while, it will randomly just crash with an exception report (I've not got the details of the error, but I'm working on that now!).
I'm trying to reproduce the circumstances by simulating a typical batch of user tasks on my pc and monitoring whats happening. I'm guessing it's some problem with threads/handles or something so I've opened up the task manager and added all the available columns.
What I've noticed is that whilst the application is running, the memory usage keeps increasing, but more worrying, the no of open handles just keeps going up and up (it's nearly 4000 handles after running through about 30 tasks).
What the application is doing is as follows:
I have a main form showing, which displays a list from a database.
Then what I'm doing is clicking down the list one by one..
What this does is to open a form on another thread to stop it blocking the main window. It does this as follows
=====
Private sub Click(rowno as int32)
dim vehicle as new dmsvehicle.vehicle
vehicle.showvehicle(Data(rowno))
end sub
=====
The Vehicle.showvehicle subroutine is as follows:
====
public sub ShowVehicle(StockNo)
Dim frm As New ViewVehicleStatus(StockNo)
Dim t As New Threading.Thread(AddressOf frm.dmsShowDialog)
'frm.StockNo = StockNo
t.Start()
end Sub
====
The "dmsShowDialog" subroutine in the form is simply doing a me.showdialog.
This all seems to work fine, and when I close the form I see a message such as "The thread '<No Name>' (0x6ec) has exited with code 0 (0x0)." appear in the output window of the development environment.
However, the no of handles just keeps increasing - I presumed that the garbage collector should tidy up every now and then, but thats not what I'm seeing.
I've not actually duplicated the users issue yet (but I have a high spec machine with masses of memory), but I suspect that this will be the cause of their problem?
Any suggestions as to what I've done wrong?
Thanks in advance
Simon
The symptom that users report is that after they have been using the application for a while, it will randomly just crash with an exception report (I've not got the details of the error, but I'm working on that now!).
I'm trying to reproduce the circumstances by simulating a typical batch of user tasks on my pc and monitoring whats happening. I'm guessing it's some problem with threads/handles or something so I've opened up the task manager and added all the available columns.
What I've noticed is that whilst the application is running, the memory usage keeps increasing, but more worrying, the no of open handles just keeps going up and up (it's nearly 4000 handles after running through about 30 tasks).
What the application is doing is as follows:
I have a main form showing, which displays a list from a database.
Then what I'm doing is clicking down the list one by one..
What this does is to open a form on another thread to stop it blocking the main window. It does this as follows
=====
Private sub Click(rowno as int32)
dim vehicle as new dmsvehicle.vehicle
vehicle.showvehicle(Data(rowno))
end sub
=====
The Vehicle.showvehicle subroutine is as follows:
====
public sub ShowVehicle(StockNo)
Dim frm As New ViewVehicleStatus(StockNo)
Dim t As New Threading.Thread(AddressOf frm.dmsShowDialog)
'frm.StockNo = StockNo
t.Start()
end Sub
====
The "dmsShowDialog" subroutine in the form is simply doing a me.showdialog.
This all seems to work fine, and when I close the form I see a message such as "The thread '<No Name>' (0x6ec) has exited with code 0 (0x0)." appear in the output window of the development environment.
However, the no of handles just keeps increasing - I presumed that the garbage collector should tidy up every now and then, but thats not what I'm seeing.
I've not actually duplicated the users issue yet (but I have a high spec machine with masses of memory), but I suspect that this will be the cause of their problem?
Any suggestions as to what I've done wrong?
Thanks in advance
Simon