473,395 Members | 1,969 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,395 software developers and data experts.

Strategy for detecting memory leaks in VB, ADO,net apps

Hi,

We have a complex application that is experiencing a "memory leak". This is
not a traditional memory, since the application gives all the memory back at
terminate. Rather what we see i that the application continues to grow at
about 2 mbytes each time the same MDI form is open and closed. Eventually,
the OS starts trashing and displays the "your system is low on virtual
memory" message. Now I know the Garbage Collector is supposed to delay
collection, but I can hardly believe it waits this long.

So the question some up how can one monitor the various object creation and
destructions and see if something is preventing their collection. The
application makes use of ADO.net and uses the SQL Server connection manager
to talk to a SQL Server 2000 DB. The application is written in Visual
Basic.net. We are running the 1.1 .net framework.

At this point we will not ship the app because of this problem!

jerry
Nov 19 '05 #1
2 6503
Check and see if you're dispoing any unneeded objects. I know that .Net is
supposed to have Garbage collection but I found that usually if you still
behave like a responsible programmer and dispose of everything that can be
disposed of. =P Especially images and large datasets. Cause sometimes you
don't orphan them properly and therefore the system thinks something is
still referencing it hence the object is never released.

"JerryK" <je***@nospam.com> wrote in message
news:OC*************@TK2MSFTNGP12.phx.gbl...
Hi,

We have a complex application that is experiencing a "memory leak". This is not a traditional memory, since the application gives all the memory back at terminate. Rather what we see i that the application continues to grow at
about 2 mbytes each time the same MDI form is open and closed. Eventually,
the OS starts trashing and displays the "your system is low on virtual
memory" message. Now I know the Garbage Collector is supposed to delay
collection, but I can hardly believe it waits this long.

So the question some up how can one monitor the various object creation and destructions and see if something is preventing their collection. The
application makes use of ADO.net and uses the SQL Server connection manager to talk to a SQL Server 2000 DB. The application is written in Visual
Basic.net. We are running the 1.1 .net framework.

At this point we will not ship the app because of this problem!

jerry

Nov 19 '05 #2
"Steve Drake" <Steve@_NOSPAM_Drakey.co.uk> wrote in message
news:uv**************@TK2MSFTNGP09.phx.gbl...
Setting object to null can help the GC, as it can work out quicker if they
are finished with.


Steve, this issue of "setting to null/Nothing" can be confusing for people
coming from a VB6 background, where it meant something similar, but
different. So, just to keep things clear for everyone - isn't it true that
this will only help the GC once it runs, but will not cause it to run any
sooner?

Also, we should try to be clear that the mechanism by which this assists GC
is very different than the mechanism of setting to Nothing in VB6. As an
example, assume you've got a class called BusinessObject which has a member
DBConnection which is an SqlConnection. Setting it to Nothing after you're
done with it helps the GC simply because the GC doesn't have to go looking
into the connection for more references - it can stop at "DBConnection". I
had the impression that the corresponding code in VB6 would decrement the
COM reference count and maybe even deallocate memory, which doesn't happen
in .NET.

I'd be willing to bet that in most cases, it costs more to set these things
to Nothing than it saves the GC.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 19 '05 #3

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

Similar topics

2
by: Jive | last post by:
The short form of the question is, how can I trace memory usage (preferably from C) with an eye toward finding out if I'm leaking memory? I would have thought there would be a ton of info on...
2
by: Generic Usenet Account | last post by:
I have been using STL for a long time now, without any problems. Recently we generated a purification report on our software using Rational Purify, and we found some memory leaks. My colleague...
0
by: Frank Lopez | last post by:
Does anyone know if Microsoft generated a whitepaper on this topic? Does anyone know what the solution is? (meaning, eliminate the leak problem -- I am seeing three memory leaks from...
2
by: ASP.Confused | last post by:
How would I go about detecting a memory leak? My web hosting provider has our site set up to only have a root "bin" folder for .NET apps, and I would like to be able to watch how much memory is...
1
by: trialproduct2004 | last post by:
Hi all I am having problem in vb.net apllication which is multithreaded. I want to detect memory leaks, total number of object which are undisposed at a time of closing application. Does anyone...
4
by: p1r0 | last post by:
Hi I was wondering if any of you could recommend me a good tool for testing for memry leaks under Windows and/or Linux Thanks in advance p1r0
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
4
by: Diego Martins | last post by:
Hi all! I am doing a crude investigation of memory leaks in objects created by external libraries. Since I don't have access to the source code, I can't tell if an object are freeing its resources...
13
by: Ilias Lazaridis | last post by:
How to detect memory leaks of python programms, which run in an environment like this: * Suse Linux 9.3 * Apache * mod_python The problem occoured after some updates on the infrastructure....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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
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...
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
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,...

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.