Memory loss problem? 
Author Message
 Memory loss problem?

Hi:

My current project seems to eat memory when it runs for long periods (over
night).  I'de appreciate any pointers etc. after you read the following
description of my project and problem.

My project is a small program that poles a com port every 10 seconds (using
timer control).  It reads a register from an isdn terminal adapter and if that
register has a certain value it will read several other registers and display
the results in one of two text boxes on my form (caller id program).

All that is on my form are the two text boxes...they are simply updated with
text1.text = text1.text & newtext & vbCrLf.

Before I start my program I check CPanel/System/Performance tab and it reports
97% free resources.  After I start my program I check again and it reports 92%
free resources.  I let the program run for several hours and check it
again...still 92%.

What could be happening overnite?  My hard drives spin down after an hour or
so...could this somehow affect my program?

My code has several subroutines and functions...several are public...nothing
unusual.  I thought that after a sub was called its temporary variables where
destroyed?

thanks,
russ

--------------------
Russell W. Patterson
Tennessee Valley Authority
Transmission/Power Supply,  System Protection
Chattanooga, Tennessee, USA (Eastern Time Zone)
phone: 423-751-6857,  fax: 423-751-2110

 --> sci.engr.electrical.sys-protection <--
http://www.*-*-*.com/



Sat, 17 Jun 2000 03:00:00 GMT  
 Memory loss problem?

Russell,

With the statement " text1.text = text1.text & newtext & vbCrLf" in the
application, you're going to run into a problem at some point.  The textbox
is going to fill up.  If every 10 seconds your adding text1 to text1 even
if you only get 1 register result it's going to multiply...

John



Quote:
> Hi:

> My current project seems to eat memory when it runs for long periods
(over
> night).  I'de appreciate any pointers etc. after you read the following
> description of my project and problem.

> My project is a small program that poles a com port every 10 seconds
(using
> timer control).  It reads a register from an isdn terminal adapter and if
that
> register has a certain value it will read several other registers and
display
> the results in one of two text boxes on my form (caller id program).

> All that is on my form are the two text boxes...they are simply updated
with
> text1.text = text1.text & newtext & vbCrLf.

> Before I start my program I check CPanel/System/Performance tab and it
reports
> 97% free resources.  After I start my program I check again and it
reports 92%
> free resources.  I let the program run for several hours and check it
> again...still 92%.

> What could be happening overnite?  My hard drives spin down after an hour
or
> so...could this somehow affect my program?

> My code has several subroutines and functions...several are
public...nothing
> unusual.  I thought that after a sub was called its temporary variables
where
> destroyed?

> thanks,
> russ

> --------------------
> Russell W. Patterson
> Tennessee Valley Authority
> Transmission/Power Supply,  System Protection
> Chattanooga, Tennessee, USA (Eastern Time Zone)
> phone: 423-751-6857,  fax: 423-751-2110

>  --> sci.engr.electrical.sys-protection <--
> http://www.tva.gov/progroup/seesuse/homepage.htm



Sat, 17 Jun 2000 03:00:00 GMT  
 Memory loss problem?

John:

Sorry I wasn't so clear.  It only adds text to the textbox when their is valid
data in the register.  The text box should (and does) only accumulate 5-6
lines of text in it over any 3-4 hour period...

...my code poles every 10 seconds but only adds text when necessary...

thanks,
russ



Quote:

>Russell,

>With the statement " text1.text = text1.text & newtext & vbCrLf" in the
>application, you're going to run into a problem at some point.  The textbox
>is going to fill up.  If every 10 seconds your adding text1 to text1 even
>if you only get 1 register result it's going to multiply...

>John



>> Hi:

>> My current project seems to eat memory when it runs for long periods
>(over
>> night).  I'de appreciate any pointers etc. after you read the following
>> description of my project and problem.

>> My project is a small program that poles a com port every 10 seconds
>(using
>> timer control).  It reads a register from an isdn terminal adapter and if
>that
>> register has a certain value it will read several other registers and
>display
>> the results in one of two text boxes on my form (caller id program).

>> All that is on my form are the two text boxes...they are simply updated
>with
>> text1.text = text1.text & newtext & vbCrLf.

>> Before I start my program I check CPanel/System/Performance tab and it
>reports
>> 97% free resources.  After I start my program I check again and it
>reports 92%
>> free resources.  I let the program run for several hours and check it
>> again...still 92%.

>> What could be happening overnite?  My hard drives spin down after an hour
>or
>> so...could this somehow affect my program?

>> My code has several subroutines and functions...several are
>public...nothing
>> unusual.  I thought that after a sub was called its temporary variables
>where
>> destroyed?

>> thanks,
>> russ

>> --------------------
>> Russell W. Patterson
>> Tennessee Valley Authority
>> Transmission/Power Supply,  System Protection
>> Chattanooga, Tennessee, USA (Eastern Time Zone)
>> phone: 423-751-6857,  fax: 423-751-2110

>>  --> sci.engr.electrical.sys-protection <--
>> http://www.tva.gov/progroup/seesuse/homepage.htm

--
--------------------
Russell W. Patterson
Tennessee Valley Authority
Transmission/Power Supply,  System Protection
Chattanooga, Tennessee, USA (Eastern Time Zone)
phone: 423-751-6857,  fax: 423-751-2110

 --> sci.engr.electrical.sys-protection <--
http://www.tva.gov/progroup/seesuse/homepage.htm


Sat, 17 Jun 2000 03:00:00 GMT  
 Memory loss problem?

Did you overlook a form unload + set form = nothing somewhere ?



Sat, 17 Jun 2000 03:00:00 GMT  
 Memory loss problem?

Claire:

Nope.  The problem has to be something in my code.  When I close my program
(the only thing I can do...everything else reports out of memory errors) it
takes 95 about 30 seconds to thrash around but it comes back to 94% free
resources and runs fine.  I must be adding something to some variable at my
pole frequency (every 10 seconds) that just blows up.  My next step is to
debug.print my variables over a long time period and see what they do...

...Do you think it would be better to debug.print the size of my variables?  
Such as 'debug.print len(myvar)' instead...since I may be padding blanks etc.

thanks,
russ

p.s.  cool last name :-)



Quote:

>Did you overlook a form unload + set form = nothing somewhere ?

--
--------------------
Russell W. Patterson
Tennessee Valley Authority
Transmission/Power Supply,  System Protection
Chattanooga, Tennessee, USA (Eastern Time Zone)
phone: 423-751-6857,  fax: 423-751-2110

 --> sci.engr.electrical.sys-protection <--
http://www.tva.gov/progroup/seesuse/homepage.htm


Sun, 18 Jun 2000 03:00:00 GMT  
 Memory loss problem?

Russ,
This is just a shot in the dark, but are you unintentionally causing
recursive events. Something like using a DO loop to wait for time to
pass in an event routine that is triggered by something external and
never exiting the event routine. This can cause stack overflows as well
as not releasing memory allocated to local variables until the program
ends.

HTH
Dave Smythia

Quote:

> Hi:

> My current project seems to eat memory when it runs for long periods (over
> night).  I'de appreciate any pointers etc. after you read the following
> description of my project and problem.

> My project is a small program that poles a com port every 10 seconds (using
> timer control).  It reads a register from an isdn terminal adapter and if that
> register has a certain value it will read several other registers and display
> the results in one of two text boxes on my form (caller id program).

> All that is on my form are the two text boxes...they are simply updated with
> text1.text = text1.text & newtext & vbCrLf.

...snip...
> My code has several subroutines and functions...several are public...nothing
> unusual.  I thought that after a sub was called its temporary variables where
> destroyed?

> thanks,
> russ

> --------------------
> Russell W. Patterson
> Tennessee Valley Authority




Sun, 18 Jun 2000 03:00:00 GMT  
 Memory loss problem?

Dave:

Thanks for taking time to consider my problem.  I've pulled my hair out for 3-4
days before stumbling across a kb article describing memory leaks when toggling
the mscomm portopen.  My program opened a com port every 10 seconds with a
timer event...I've corrected it to hold the port open the entire time the
project is running...fixed.

thanks,
russ

fyi information:
8. FIX: Toggling PortOpen w/MSCOMM32.OCX Leaks Memory on Win95
Excerpt from this page: When using the PortOpen method of the MSCOMM32.OCX
control, continuous or multiple uses of this method will produce a memory
drain. The exact amount of memory and resources lost varies with different
port drivers installed. STATUS ====== Microsof... (size 8,102 bytes, updated
12/19/97 4:56:42 PM GMT)

http://premium.microsoft.com/support/kb/articles/q171/4/72.asp


Quote:

>Russ,
>This is just a shot in the dark, but are you unintentionally causing
>recursive events. Something like using a DO loop to wait for time to
>pass in an event routine that is triggered by something external and
>never exiting the event routine. This can cause stack overflows as well
>as not releasing memory allocated to local variables until the program
>ends.

>HTH
>Dave Smythia


>> Hi:

>> My current project seems to eat memory when it runs for long periods (over
>> night).  I'de appreciate any pointers etc. after you read the following
>> description of my project and problem.

>> My project is a small program that poles a com port every 10 seconds (using
>> timer control).  It reads a register from an isdn terminal adapter and if
that
>> register has a certain value it will read several other registers and
display
>> the results in one of two text boxes on my form (caller id program).

>> All that is on my form are the two text boxes...they are simply updated with
>> text1.text = text1.text & newtext & vbCrLf.

>...snip...
>> My code has several subroutines and functions...several are public...nothing
>> unusual.  I thought that after a sub was called its temporary variables
where
>> destroyed?

>> thanks,
>> russ

>> --------------------
>> Russell W. Patterson
>> Tennessee Valley Authority


--
--------------------
Russell W. Patterson
home--> rpatt  at  tva.campus.mci.net
work--> rwpatterson  at  tva.gov
   --> sci.engr.electrical.sys-protection <--
http://www.tva.gov/progroup/seesuse/homepage.htm
------------------------------------------------


Wed, 21 Jun 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Quality :: Loss memory :: Alocate/Free memory

2. Windows 98 Memory Loss

3. memory loss w/rdo

4. error 7 memory loss

5. memory loss running vb application

6. Picture Box and Memory Loss under Win95

7. memory loss w/rdo

8. Memory Loss

9. CRPE.DLL causes memory loss in VB4 16 bit app

10. ADO 2.5 Sql Server Ole Db Provider and Memory Loss

11. ADO memory loss

12. Memory loss using Video Capture

 

 
Powered by phpBB® Forum Software