473,789 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tracking Memory Leaks

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
7 3910
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
Thank you those were very helpful and pointed out that i do NOT have a
memory leak.

Thanks :)
"Kerry Moorman" <Ke**********@d iscussions.micr osoft.com> wrote in message
news:7F******** *************** ***********@mic rosoft.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
"Gary Townsend" <ga**********@h otmail.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.c om/Community/UserSamples/Details.aspx?Sa mpleGuid=325432 5d-a4aa-4bb3-aa86-c72d5104ec74>

CLR Profiler (v2.0)
<URL:http://www.microsoft.c om/downloads/details.aspx?Fa milyId=86CE6052-D7F4-4AEB-9B7A-94635BEEBDDA&di splaylang=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
Wow those profilers were really neat utilities...ver y useful thanks.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:eP******** ******@TK2MSFTN GP14.phx.gbl...
"Gary Townsend" <ga**********@h otmail.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&di splaylang=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
i have some code that utilizes the system.diagnost ic 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
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********@yah oo.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
i have some code that utilizes the system.diagnost ic 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
You'll have to import System.Diagnost ics 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 fnLogMemoryUsag e(ByVal psCodeLocation As String, ByVal
pTrace As TextWriterTrace Listener)
dUsage = proc.PrivateMem orySize - iPrivMemSz
sUsage = dUsage.ToString ("N").PadLeft(1 3) & " " &
proc.PrivateMem orySize.ToStrin g("N").PadLeft( 15)
pTrace.WriteLin e(Now & " " & psCodeLocation & " --->>> " &
sUsage)
iPrivMemSz = proc.PrivateMem orySize
proc.Refresh()
End Sub

Nov 21 '05 #8

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

Similar topics

4
16694
by: Maurice | last post by:
Hi there, I'm experiencing big memory problems on my webserver. First on an old RedHat 7.2 system, now on an other fresh installed Suse 8.2 system: Linux version 2.4.20-4GB (root@Pentium.suse.de) (gcc version 3.3 20030226 (prerelease) (SuSE Linux)) #1 Wed Aug 6 18:26:21 UTC 2003 Apache 1.3.27-41 PHP 4.3.1-52 MySQL 3.23.55-20
0
1871
by: Steve Binney | last post by:
My code makes synchronous HttpWebRequest and HttpRebResponse calls. In VS 2003, I am getting memory leaks and event handle leaks. I am closing all streams and using "using"statements. I have used .Net memory profiler from Sci Tech to analyze the leaks and they are coming from inside HttpWebRequest and HttpRebResponse. When I run my code on VS2005, I do not get any leaks. Is this problem fixed in .Net 1.1 SP1? I may not be able to wait...
10
2332
by: Generic Usenet Account | last post by:
I have worked out a very simple method for tracking the "memory growth" of a process at run time. It involves a header file and a shell script. Here's the header file: ////////// Header File Begin /////////////// #ifndef _VIRTMEMINFO_H_ #define _VIRTMEMINFO_H_ #include <stdio.h>
2
4958
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...
8
3414
by: ranjeet.gupta | last post by:
Dear All Is the Root Cause of the Memory corruption is the Memory leak, ?? suppose If in the code there is Memory leak, Do this may lead to the Memory Corruption while executing the program ? In nut shell, what is/are the realtion/s between the Memory Leak and Memory Corruption. Juts Theoritical Assumtion below:
14
2734
by: MKoool | last post by:
I have an application with one function called "compute", which given a filename, goes through that file and performs various statistical analyses. It uses arrays extensively and loops alot. it prints the results of it's statistical significance tests to standard out. Since the compute function returns and I think no variables of global scope are being used, I would think that when it does, all memory returns back to the operating...
3
5327
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?
22
2279
by: Frank Rizzo | last post by:
I have an object tree that is pretty gigantic and it holds about 100mb of data. When I set the top object to null, I expect that the .NET framework will clean up the memory at some point. However, I am looking at the Task Manager and I don't see the MemUsage column decreasing even after an hour or two. I know that TaskManager may not be the best place to see what is the true way to gauge memory usage and/or presense of memory leaks. So...
16
5105
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
9511
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
10195
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
10136
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
9979
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
9016
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
6765
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
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
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.