473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

possible memory leak VB.Net app automating IE6 under XP Pro ... looking for clues


I'm having difficulty with memory loss on an application that
automates IE6 under XP (pro, fully up to date) using VB.Net. Every 30
minutes (triggered by the XP scheduler) the application visits a
number (100s) of web sites. I noted that the system began running
slower and slower over time and was trying to understand what was
going on. I'm using performance monitor to track available memory,
send/recv bytes per second, etc. In looking at the perf mon results,
memory decreases during each run and is partially restored when the
run completes. Over time (days) memory degrades and the system
continues to run progressively slower.

Has anyone had similar experiences with long term heavy use of IE6
under XP? Does anyone have an idea of what might be causing the loss?
Does anyone have any idea of how to determine what component (VB,
..NET, IE6, ??) might be leaking memory?

Thanks for any clues.

Richard

Nov 20 '05 #1
6 2648
Hi Richard,

How do you automate it (using the webbrowser?)

Cor
Nov 20 '05 #2

How do you automate it (using the webbrowser?)


The automation is via the SHDocVw.InternetExplorer object. Automation
generally appears to be sound, at least insofar as it is functional,
with few hangs ( on the order of .5 per day). Unfortunately the hangs
are so infrequent that I've not been able to gain much insight into
the hang issue. In the end, it turns out that the hangs are more of a
nuisance than a problem as the system scheduler will delete the hung
run (leaving the IE object still alive) and re-run the application at
the next 30 minute interval. Additionally, memory degradation occurs
absent the hangs. All that said, I'm somewhat suspicious that IE
leaks memory but since both IE and the application terminate and
memory still leaks, I'm not really sure.

R

Nov 20 '05 #3
Hi Richard,

Have you build it in a component so that I disposable is implemented?

Cor
Nov 20 '05 #4

Cor,

I've been out of town for a few days.
Have you build it in a component so that I disposable is implemented?


Here is what I think is the relevant code (BTW, while I'm a very
experienced programmer, I'm still fairly new to VB):

==========================================

Class TestData
...
Public WithEvents oIE As SHDocVw.InternetExplorer ' the copy
of IE we automate
...
Sub RunTest()
...
If Not SetupIE() Then Return ' start IE or quit
For Each urle In Me.alURLEntries ' loop through list of
URLs
DoThisURL(urle) ' actually process this URL
Next

Me.oIE.Quit() ' close my IE
OutLogNL("EndTest")
End Sub

Function SetupIE() As Boolean ' create an IE to automate
Try
Me.oIE = New SHDocVw.InternetExplorer ' create teh
IE object
Catch ex As Exception ' die on failure
OutLogNL("Tester: Unable to setup IE " & ex.ToString)
Return False
End Try
Me.oIE.Visible = True ' make IE visible
Return True
End Function
....
End Class

....
Public oTestData As TestData ' the test data
....

Sub Main()
oTestData = New TestData ' create our test data object
GetArguments() ' get all our arguments, into
oTestData
'oTestData.DumpURLs()
OutLogSetup() ' setup our output files
oTestData.RunTest() ' actuall run the test
Cleanup() ' do any cleanup
End Sub

==========================================

While I'm new to VB, my understanding is that this will insure that
all storage will be unallocated when the application terminates so
that I need not explicitly deallocate either oTestData or the
contained objects. Is this correct?

Your question caused me to wonder if I might have memory leaking from
some other source. I explicitly create via New a number of
System.Threading.AutoResetEvent and ArrayList ( and its content). As
above, my understanding is that these need not be explicitly released
when the application terminates.

Finally I create some file I/O handles

Public fsFileLog As StreamWriter ' the log file
Public fsFileOut As StreamWriter ' the output file

but go to some care to insure that they are closed before the program
terminates.

Does any of this appear to be doubtful?

Thanks,
Richard

Nov 20 '05 #5
Hi Richard,

I think that the problem is that you are using a unmanaged resource without
that Idisposable is implemented.

To use that you can create your class in a component and place the
constructions in the right places (just look how it is done in a form).

(Just add a component item to your IDE and than some copying and pasting, it
is not as difficult as you first think when you read what is written below).

http://msdn.microsoft.com/library/de...ClassTopic.asp

I gues (however I am not sure) that you get than a better result.

Cor
Nov 20 '05 #6
Cor,

Thanks, I'll look into that some more, but at first glance IComponent
seems to be part of forms oriented applications and this is a command
line app.

R

On Tue, 20 Jul 2004 11:08:06 +0200, "Cor Ligthert"
<no**********@planet.nl> wrote:
Hi Richard,

I think that the problem is that you are using a unmanaged resource without
that Idisposable is implemented.

To use that you can create your class in a component and place the
constructions in the right places (just look how it is done in a form).

(Just add a component item to your IDE and than some copying and pasting, it
is not as difficult as you first think when you read what is written below).

http://msdn.microsoft.com/library/de...ClassTopic.asp

I gues (however I am not sure) that you get than a better result.

Cor


Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Debian User | last post by:
Hi, I'm trying to discover a memory leak on a program of mine. I've taken several approaches, but the leak still resists to appear. First of all, I've tried to use the garbage collector to...
6
by: Tom | last post by:
We have a VERY simple .NET C# Form Application, that has about a 23MB Memory Footprint. It starts a window runs a process and does a regular expression. I have done a GC.Collect to make sure that,...
0
by: Frank Lopez | last post by:
My program structure is: 1. 2. 3. => manually does the crt-init and crt-terminate calls 4. -- this is accessed by the unmanaged C++ classes in (3) using LoadLibrary and FreeLibrary
12
by: Grahamo | last post by:
Hey, this is related to absolutely nothing in particular and is of no importance whatsoever except for my curiousity. Does anybody have an example of a particularly tricky memory leak that's...
13
by: Boni | last post by:
I use 3-d party component. In this component I must pass a reference to my object. The problem is that this component has an ugly bug.When this component is disposed, it incorrectly don't delete...
1
by: Joe Peterson | last post by:
I've been doing a lot of searching on the topic of one of Python's more disturbing issues (at least to me): the fact that if a __del__ finalizer is defined and a cyclic (circular) reference is...
22
by: Simon | last post by:
Hi all, I have a huge memory leak problem in what is really very simple data insert code. In my app I'm trying to use a typed dataset to insert into a database. It adds quite a few rows (say...
3
xarzu
by: xarzu | last post by:
Apart from buying BoundsChecker or any of the other tools to track down memory leaks. Does anyone have any advice or tips from your years of programming experience to offer on how to track down the...
16
by: graham.keellings | last post by:
hi, I'm looking for an open source memory pool. It's for use on an embedded system, if that makes any difference. Something with garbage collection/defragmentation would be nice. It should have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.