473,799 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6515
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.c om> wrote in message
news:OC******** *****@TK2MSFTNG P12.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******** ******@TK2MSFTN GP09.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 "DBConnecti on". 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***********@s urfcontrol.com

Nov 19 '05 #3

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

Similar topics

2
1861
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 this, but I've been googling for half and hour and I keep coming up empty. I've recently ported Python to a realtime operating system, and I've implemented a small C extension module. The system controls a piece of equipment. A test program runs...
2
4959
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 claims that some of the memory leaks are due to the fact that "STL is wrought with memory leaks". Of course I disagree. I think that there are no "inherent leaks" with STL, but if used improperly, leaks will occur. One common source of leak that...
0
3908
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 dllmodul.cpp(102) similar to what is mentioned below)... I am calling MFC as part of unmanaged code used by the managed code. +--------
2
1672
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 being allocated for the entire site (since the site acts as one big application.) Is there anyway to do this through code? The reason I ask is because occasionally, our site will start having session state loss. After a day or two, it goes back...
1
948
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 know any utility or application for detecting undisposed object as well as memory leaks. Please help me. thanks in advance.
4
2881
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
5328
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". Anybody know anything about this? Does *Javascript* leak memeory, or does the *browser* leak memory?
4
1671
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 properly during destruction. For now, I need a portable function that can tell me the available free store memory. With that, I can do things like: size_t mem = getFreeStoreAvailable(); {
13
2863
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. It's most possibly caused by trac and it's dependencies, but several components of the OS where updated, too.
0
9688
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
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
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
10268
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...
0
10031
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9079
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...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.