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

finding memoryleak

LS
I have consoleapplication which is always running fine for serval weeks
until I get an "out of memory exception"
I thougth the dotnet framework was supposed to handle my bad programming :)
What is the best method to find this memoryleak?

Regards

Geert
Nov 21 '05 #1
7 985
Geert,

Can you show a little piece of your code.

(How do you instance by example objects and values)

Cor
Nov 21 '05 #2
LS
> Can you show a little piece of your code.

euh, the program is rather long:
I think I do it the way it should be.

I always do

dim blabla as someobject

And at the end

blabla.dispose
Nov 21 '05 #3
Where do you do this,
dim blabla as someobject


Because not everybody does that the same

Cor
Nov 21 '05 #4
LS
> Where do you do this,
dim blabla as someobject


Because not everybody does that the same

At the beginning of the function/method.
Can you give me an example of how to do it good and bad.
Anyhow isn't dotnet supposed to do garbagecollection?
Nov 21 '05 #5
LS,

In my opinion is this very bad
private a as arraylist
private b as new object
Sub C
a = new arraylist
a.add(b)
End sub

I did not test it if there is some extra intelligence, however I assume that
all those new created arraylist stay until the end of the program because
they have all a reference to b.

Sub D
dim a as new arraylist
dim b as new object
a.add(b)
End sub

Here you are sure that all goes out of scope and by the objects used memory
will be released by the GC. However this last one is not always possible of
course.

Cor


Nov 21 '05 #6
"LS" <in*****@invalid.com> schrieb:
I have consoleapplication which is always running fine for serval weeks
until I get an "out of memory exception"
I thougth the dotnet framework was supposed to handle my bad programming
:)
What is the best method to find this memoryleak?


Allocation Profiler src
<URL:http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=3254325d-a4aa-4bb3-aa86-c72d5104ec74>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7
If you're willing to pay $100, or if you can find the solution within the
14day trial period you can download this tool:

http://www.scitech.se/memprofiler/download.aspx

I find it very usefull

hth

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
Nov 21 '05 #8

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

Similar topics

1
by: Tristan | last post by:
Im trying to expand a search util by uing regular expression to allow common search criteria such as +-* and phrases "". My understanding of ereg(string pattern, string string, ) is that the...
11
by: Fuzzyman | last post by:
What's the best, cross platform, way of finding out the directory a script is run from ? I've googled a bit, but can't get a clear answer. On sys.argv the docs say : argv is the script name...
1
by: Phil Watkins | last post by:
I am a novice programer in Vb and I am having a major brain ache finding out which item has been selected within a list view and then either deleting that item or editing them. My searching so...
0
by: Helge Jensen | last post by:
Having posted in microsoft.public.dotnet.framework.sdk and microsoft.public.dotnet.framework.wmi without receiving any response, I posthere on the off-chance that someone who isn't following those...
3
by: KL | last post by:
Well, I am back. This time our assignment has us filling a vector and then timing how long it takes to find a spot in the vector to insert a new item, and the time required to insert the item...
8
by: Rick Strahl [MVP] | last post by:
Hi all, I'm building an app that uses the ASP.Net runtime... One problem I've run into is that pages running inside of the runtime are not finding DLLs in the GAC. In fact, if I look at the...
2
by: ElkGroveR | last post by:
Hi there! I'm using PHP to create a simple, dynamic MySQL SELECT query. The user chooses a selection from a HTML Form SELECT element's many options and submits the form via a POST action. ...
0
by: NSF12345 | last post by:
Iv developed a small program that looks for a file over our network, and copy it to the location of another computer. Im using the "If FileExists("\\oldpc\main share\Folder\file.txt") Then" way of...
4
by: krishnai888 | last post by:
I had already asked this question long back but no one has replied to me..I hope someone replies to me because its very important for me as I am doing my internship. I am currently writing a code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...

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.