473,325 Members | 2,671 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,325 software developers and data experts.

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 1598
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****@discussions.microsoft.com> schreef in bericht
news:76**********************************@microsof t.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****@discussions.microsoft.com> schreef in bericht
news:76**********************************@microsof t.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
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...
0
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...
4
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...
2
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...
8
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 ? ...
0
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...
4
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...
23
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
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". ...
16
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.