By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

Tracking Memory Leaks

P: n/a
I have written a program in vb .net and want to go about trying to track
down a memory leak when i run my program and monitor it using the task
manager in windows 2k my program has a stead progression of memory usage
upwards. I have done all the well behaved things such as using dispose where
i can. So i guess i need to try and track down where approximately i am
using up my memory. Any suggestions?
Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Gary,

http://www.itwriting.com/dotnetmem.php

http://getdotnetco.web101.discountas...%20Mystery.htm

http://groups.google.com/group/micro...2c39983d?hl=en

Kerry Moorman
"Gary Townsend" wrote:
I have written a program in vb .net and want to go about trying to track
down a memory leak when i run my program and monitor it using the task
manager in windows 2k my program has a stead progression of memory usage
upwards. I have done all the well behaved things such as using dispose where
i can. So i guess i need to try and track down where approximately i am
using up my memory. Any suggestions?

Nov 21 '05 #2

P: n/a
Thank you those were very helpful and pointed out that i do NOT have a
memory leak.

Thanks :)
"Kerry Moorman" <Ke**********@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
Gary,

http://www.itwriting.com/dotnetmem.php

http://getdotnetco.web101.discountas...%20Mystery.htm
http://groups.google.com/group/micro...2c39983d?hl=en
Kerry Moorman
"Gary Townsend" wrote:
I have written a program in vb .net and want to go about trying to track
down a memory leak when i run my program and monitor it using the task
manager in windows 2k my program has a stead progression of memory usage
upwards. I have done all the well behaved things such as using dispose where i can. So i guess i need to try and track down where approximately i am
using up my memory. Any suggestions?

Nov 21 '05 #3

P: n/a
"Gary Townsend" <ga**********@hotmail.com> schrieb:
I have written a program in vb .net and want to go about trying to track
down a memory leak when i run my program and monitor it using the task
manager in windows 2k my program has a stead progression of memory usage
upwards. I have done all the well behaved things such as using dispose
where
i can. So i guess i need to try and track down where approximately i am
using up my memory. Any suggestions?


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

CLR Profiler (v2.0)
<URL:http://www.microsoft.com/downloads/details.aspx?FamilyId=86CE6052-D7F4-4AEB-9B7A-94635BEEBDDA&displaylang=en>

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

Nov 21 '05 #4

P: n/a
Wow those profilers were really neat utilities...very useful thanks.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eP**************@TK2MSFTNGP14.phx.gbl...
"Gary Townsend" <ga**********@hotmail.com> schrieb:
I have written a program in vb .net and want to go about trying to track
down a memory leak when i run my program and monitor it using the task
manager in windows 2k my program has a stead progression of memory usage
upwards. I have done all the well behaved things such as using dispose
where
i can. So i guess i need to try and track down where approximately i am
using up my memory. Any suggestions?
Allocation Profiler src

<URL:http://www.gotdotnet.com/Community/U...px?SampleGuid=
3254325d-a4aa-4bb3-aa86-c72d5104ec74>
CLR Profiler (v2.0)
<URL:http://www.microsoft.com/downloads/d...86CE6052-D7F4-
4AEB-9B7A-94635BEEBDDA&displaylang=en>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

P: n/a
i have some code that utilizes the system.diagnostic namespace if
you've not solved your problem. You basically a small function at
various points in your program and it gets the current amt of memory
used by your code at that point....i log mine to a file after its ran
awhile.

Nov 21 '05 #6

P: n/a
Thank you but after the helpful tips ehre i found that i do not have a
memory leak. However if you are willing to share your code I will look at it
for sure and who knows maybe someone else might benefit from it.

<ml********@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
i have some code that utilizes the system.diagnostic namespace if
you've not solved your problem. You basically a small function at
various points in your program and it gets the current amt of memory
used by your code at that point....i log mine to a file after its ran
awhile.

Nov 21 '05 #7

P: n/a
You'll have to import System.Diagnostics first then call the function
below passing in where you are in your code...ie., something meaning
full to you...the trace stuff is just a fancy log file..u can replace
with debug.writeline if u wish

Public Sub fnLogMemoryUsage(ByVal psCodeLocation As String, ByVal
pTrace As TextWriterTraceListener)
dUsage = proc.PrivateMemorySize - iPrivMemSz
sUsage = dUsage.ToString("N").PadLeft(13) & " " &
proc.PrivateMemorySize.ToString("N").PadLeft(15)
pTrace.WriteLine(Now & " " & psCodeLocation & " --->>> " &
sUsage)
iPrivMemSz = proc.PrivateMemorySize
proc.Refresh()
End Sub

Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.