473,774 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2665
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.Interne tExplorer 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.Interne tExplorer ' 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("EndTe st")
End Sub

Function SetupIE() As Boolean ' create an IE to automate
Try
Me.oIE = New SHDocVw.Interne tExplorer ' create teh
IE object
Catch ex As Exception ' die on failure
OutLogNL("Teste r: 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.Dump URLs()
OutLogSetup() ' setup our output files
oTestData.RunTe st() ' 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.Threadin g.AutoResetEven t 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**********@p lanet.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
construction s 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
8716
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 look for uncollectable objects. I've used the next: # at the beginning of code gc.enable()
6
3278
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, no memory is lying around. GC reports only 84k of allocations. Starting 5-10 of this apps is going to start taking a considerable amount of memory. Is there a way to reduce this? Tom
0
2062
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
1351
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 hard to spot. I'd like to see something that's a little unusual or obscure. something that involves some in depth knowledge about functionality X or scenario X and that causes a memory leak. Something that would be really easy to miss.
13
1548
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 the reference to my object from one of its shared lists.And since the operation repeats many times the leak is huge. Is there a way to kill my object anyway? Thanks a lot, Boni
1
2270
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 made, the garbage collector cannot clean it up. First of all, it seems that it's best to avoid using __del__. So far, I have never used it in my Python programming. So I am safe there. Or am I? Also, to my knowledge, I have never created a...
22
2214
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 hundreds). Unfortunately it has a big ass memory leak and I dont understand why. The code below demonstrates the memory leak. It's like nothing is
3
1559
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 causes of memory leaks? I find that the big dump that happens at the end of a program does not typically lend any useful clues as to where or what was allocated that was not freed. I find that I have to back track and comment out sections of code...
16
5104
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 the ability to allocate different size chunks of memory not just a single size. It should error check for double free, etc. And it should be usable by a mixture of C and C++ subsystems. If I get that, I'm happy. Thank you very much.
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.