Here is a mockup of my applicaiton. Notice that I have commented out the
thread that I was starting and the problem still occurs. If the progarm is
run, I can watch it in the task manager and it continues to grow in memory.
The flags are being set by a serial port routine. I have tried a system
timer and form timer, same result. I attempted the System.GC.Colle ct at the
end of the Tick Event, same result. No matter what I have tried, same
result.
Public Class Form1
Inherits System.Windows. Forms.Form
Dim counter As Int16
Dim TxFlag As Boolean
Dim RxFlag As Boolean
Dim RxCommFlag As Boolean
Dim TxCommFlag As Boolean
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As
System.EventArg s) Handles Timer1.Tick
'Dim Tx As New Thread(AddressO f sendcomm)
If TxFlag And RxCommFlag Then
TxFlag = False
RxCommFlag = False
counter = 0
End If
If Not TxFlag And Not RxCommFlag Then
TxFlag = True
'Tx.Start()
End If
If TxFlag And Not RxCommFlag Then
counter = counter + 1
End If
If counter > 200 Then
TxFlag = False
RxCommFlag = False
counter = 0
End If
End Sub
"Brian Gideon" <br*********@ya hoo.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
wg,
Can you be more specific? Better yet, can you post a short, but
complete program that demonstrates the problem?
What flags are you setting? What timer are you using? What else are
you doing inside in the timer event and elsewhere in the program?
Brian
wg wrote: Can someone help me with this. I have a application in which a timer runs
all the time. I set some flags in side the timer so there is nothing
inside
to cause a problem. However if I run the app, it continually grows in
memory. If I leave it long enough it will eventually grow out of control
How
can I deal with this?
Thanks
wg