|
-
May 25th, 2005, 11:34 AM
#1
Thread Starter
Addicted Member
Testing for memory leaks
What is the best way to test for memory leaks in your program?
-
May 25th, 2005, 12:37 PM
#2
Re: Testing for memory leaks
If you don't want memory leaks, then do use any of the .Net languages. They don't suffer from memory leaks due to the memory management (Garbage Collector).
And you can't test for memory leaks by definition anyway, that would imply that you know where the wild pointers are pointing, hence no leak.
I don't live here any more.
-
May 25th, 2005, 12:45 PM
#3
Thread Starter
Addicted Member
Re: Testing for memory leaks
Memory leaks can still be caused by .Net. The garabe collector will free any memory from unused objects. However that is a poor programming practice to just let objects fly around with no reguard to properly disposing them. Surely there must be some utility out there that can give you some information on a possible leak in your code.
-
May 25th, 2005, 12:54 PM
#4
Re: Testing for memory leaks
 Originally Posted by Porsche944
Memory leaks can still be caused by .Net. The garabe collector will free any memory from unused objects. However that is a poor programming practice to just let objects fly around with no reguard to properly disposing them. Surely there must be some utility out there that can give you some information on a possible leak in your code.
you could certainly look at the memory usage for the app in the task manager. If indeed you have stray objects not being relinquished, then in time your app should consume more and more memory. Another app that gives lots of memory usage is the process viewer that shipped with Visual Studio 6.0 tool set.
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
May 25th, 2005, 01:35 PM
#5
Re: Testing for memory leaks
Strictly speaking, letting objects lying around unused isn't a memory leak, just sloppy programming. Like wossname has indicated, memory leaks are not possible in .Net - however that doesn't mean that the garbage collector acts in ways that make sense (well, common sense anyway ).
There are several utilities that you can use to profile .Net apps (out of the top of my head I would recommend CLR Profiler). Also, take a look at the performance monitor, there are a bunch of .Net counters that involve memory metrics.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|