473,770 Members | 5,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

memory leaks

Some time ago I was looking for a cheap or free way to check an application
written in C# and some unsafe code for memory leaks. Someone in this forum
suggested DevPartner form Compuware, telling me that there is a free basic
version out there. However I can’t find it. Nowhere on the Compuware website
is a link to anything under $4000. Am I just missing something? Are there
other ways to check for memory leaks than 3rd party products?
Apr 16 '06 #1
5 1624
The easiest way I know of to check for memory leaks is:
step 1. open Task Manager.
step 2. write down Available Memory from the Performance tab.
step 3. open Your App.
step 4. write down Available Memory from the Performance tab.
step 5. close Your App.
step 6. repeate steps 2 thru 5 several times.

Results: if Available Memory keeps reducing, you have a memory leak.

step 7. between steps 3 & 4, use your App so that all the modules and
objects in your app get used.

Results: if Available Memory keeps reducing, you have a memory leak.

This is not a full-proof way of checking. But is a start in the right
direction, for free.
"cnickl" wrote:
Some time ago I was looking for a cheap or free way to check an application
written in C# and some unsafe code for memory leaks. Someone in this forum
suggested DevPartner form Compuware, telling me that there is a free basic
version out there. However I can’t find it. Nowhere on the Compuware website
is a link to anything under $4000. Am I just missing something? Are there
other ways to check for memory leaks than 3rd party products?

Apr 17 '06 #2
Cnickl,

Why would you do it .Net is created to prevent memoryleaks.

If you have them than look at those 3 threads where Willy was active. If you
don't find it, than you can search in it using everytime that Willy. He has
written it here the most in dept.

One thing you should not do, is pay attention to the taskmanger, that is a
kind of fuel indicator how many kilometers/miles you can still go, but
certainly not accurate.

I hope this helps,

Cor
"cnickl" <cn****@discuss ions.microsoft. com> schreef in bericht
news:76******** *************** ***********@mic rosoft.com...
Some time ago I was looking for a cheap or free way to check an
application
written in C# and some unsafe code for memory leaks. Someone in this forum
suggested DevPartner form Compuware, telling me that there is a free basic
version out there. However I can't find it. Nowhere on the Compuware
website
is a link to anything under $4000. Am I just missing something? Are there
other ways to check for memory leaks than 3rd party products?

Apr 17 '06 #3
Thanks to both of you. My reason for check for memory leaks is that I’m using
some unsafe (unmanaged) code missed with .NET.
Apr 17 '06 #4
Cor,
If you followed my steps exactly, it would show modules not unloading and
resources not being released. Resources and memory would then be reallocated
for each new instance of the program loaded into memory. Eventually you'll
have no memory to load the program into if you're program is not releasing
everything upon exit. I fully understand Windows caching and that's why I
said several times. I defy anyone to show how using my procedures exactly
that you wouldn't have a memory leak with constantly reducing memory and
resources.
Now, it is still possible to have a memory leak and not have the memory
being reduced under task manager. I didn't say my way was 100% accurate. But
that it was free and would spot the worse offenders.

FYI, there are two very popular games and a major software product that fail
the test that I showed. The solution all three manufacturers suggest is to
reboot the system. Even though they don't admit it, sounds like a memory leak
to me.

And another note: You could always do a memory dump. But this is very hard
and is why programs are written costing 4k, or more, to do. But if you know
how to do this, it is the most accurate. In my former life, I don't know how
many thousands of pages of memory dumps that I manually sifted through to
write assembly programs that would do exactly what I wanted them to do.
Thanks.
"Cor Ligthert [MVP]" wrote:
Cnickl,

Why would you do it .Net is created to prevent memoryleaks.

If you have them than look at those 3 threads where Willy was active. If you
don't find it, than you can search in it using everytime that Willy. He has
written it here the most in dept.

One thing you should not do, is pay attention to the taskmanger, that is a
kind of fuel indicator how many kilometers/miles you can still go, but
certainly not accurate.

I hope this helps,

Cor
"cnickl" <cn****@discuss ions.microsoft. com> schreef in bericht
news:76******** *************** ***********@mic rosoft.com...
Some time ago I was looking for a cheap or free way to check an
application
written in C# and some unsafe code for memory leaks. Someone in this forum
suggested DevPartner form Compuware, telling me that there is a free basic
version out there. However I can't find it. Nowhere on the Compuware
website
is a link to anything under $4000. Am I just missing something? Are there
other ways to check for memory leaks than 3rd party products?


Apr 17 '06 #5
Hi again,
If your using code for ISO900x, stop. Unless you're part of the developement
team or document control team, you could be risking your company's rating.
Uncontrolled or unmanaged code in those envirnoments may not work as intended
and are works in progress at best.
Thanks.

"cnickl" wrote:
Thanks to both of you. My reason for check for memory leaks is that I’m using
some unsafe (unmanaged) code missed with .NET.

Apr 17 '06 #6

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

Similar topics

4
16693
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...
4
2351
by: Morten Aune Lyrstad | last post by:
Ok, now I'm officially confused. I have a large project going, which uses a win32 ui library I am developing myself. And I'm getting weird memory leaks. I don't know if I can explain what is going on, but I really need some help on this one. Ok, so I have this class defined (written by Randy Charles Morin, www.kbcafe.com) which detects memory leaks. It creates a memory check point in the constructor, and another in the destructor, and...
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:
0
3907
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. +--------
4
5728
by: ali.jan | last post by:
Hi, It is trivial to load an assembly in a new Application Domain. Is there any way of loading an assembly in a new process? I tried using the Process class like this: Process p = new Process() p.StartInfo.FileName = mStartupFile p.StartInfo.UseShellExecute = False
23
4570
by: James | last post by:
The following code will create memory leaks!!! using System; using System.Diagnostics; using System.Data; using System.Data.SqlClient; namespace MemoryLeak
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?
16
5104
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
9595
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
9432
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
10232
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...
1
10008
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
9873
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
5313
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
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
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
3578
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.