Board index » Visual Studio » Locating resource leaks

Locating resource leaks

Visual Studio149
Are there any good tools to help diagnose resource / memory leaks in VB 6

apps ?



Thnks

Bruce


-
 

Re:Locating resource leaks

Thanks for the laugh



Robert



"Beeeeeeeeeeeeves" <Beeeeeeeeeeeeves@discussions.microsoft.com>wrote in

message news:28EBB78B-65FD-4E99-AE47-291B1170E71B@microsoft.com...

Quote
VB doesn't have memory leaks. Don't get ideas above your station.



"Bruce Baker" wrote:



>Are there any good tools to help diagnose resource / memory leaks in VB

6

>apps ?

>

>Thnks

>Bruce

>

>

>





-

Re:Locating resource leaks

If you say so. Quite chuckle in the corner.





"Beeeeeeeeeeeeves" <Beeeeeeeeeeeeves@discussions.microsoft.com>wrote in

message news:28EBB78B-65FD-4E99-AE47-291B1170E71B@microsoft.com...

Quote
VB doesn't have memory leaks. Don't get ideas above your station.



"Bruce Baker" wrote:



>Are there any good tools to help diagnose resource / memory leaks in VB

6

>apps ?

>

>Thnks

>Bruce

>

>

>





-

Re:Locating resource leaks

OK, seriously.

I know of no tool that really can help you find resource or memory leaks in

VB, which supports VB natively. Tools like, e.g., Rational Purify can find

memory leaks, but you won't see how they are related to your code. It just

helps to compare a before - after (but don't ask the price).



It might make sense to use a code inspector, such as the one included in

MZ-Tools (www.mztools.com/).">www.mztools.com/).



Generally, I've found the following "hot spots", where memory or resource

leaks are most likely to occur (always depending on what exactly you

understand as a memory or resource leak):



*) Form unloading

Explicitly create instances of your forms, and keep these variables. This

gives you control over the lifecycle.

e.g.

Dim MyForm as frmMyForm



Set MyForm = New frmMyForm

Load MyForm

MyForm.Show

[...]

MyForm.Hide

Unload MyFrom

Set MyForm = Nothing



*) Avoid the 'Dim [...] as NEW'



*) Ensure all objects have correctly terminated

Use reference counters in the _Initialize and _Terminate events. Check these

reference counters.



*) 3rd party ActiveX-Controls



Also ensure you have the newest VB Service pack



Robert









"Bruce Baker" <bruceb@ardex.com.au>wrote in message

Quote
Are there any good tools to help diagnose resource / memory leaks in VB 6

apps ?



Thnks

Bruce









-

Re:Locating resource leaks

Forgot to mention the graphic card drivers. They can be big trouble if you

use certain drawing operations.



Robert



"Robert" <noone@nowhere.com>wrote in message

Quote
OK, seriously.

I know of no tool that really can help you find resource or memory leaks

in

VB, which supports VB natively. Tools like, e.g., Rational Purify can find

memory leaks, but you won't see how they are related to your code. It just

helps to compare a before - after (but don't ask the price).



It might make sense to use a code inspector, such as the one included in

MZ-Tools (www.mztools.com/).">www.mztools.com/).



Generally, I've found the following "hot spots", where memory or resource

leaks are most likely to occur (always depending on what exactly you

understand as a memory or resource leak):



*) Form unloading

Explicitly create instances of your forms, and keep these variables. This

gives you control over the lifecycle.

e.g.

Dim MyForm as frmMyForm



Set MyForm = New frmMyForm

Load MyForm

MyForm.Show

[...]

MyForm.Hide

Unload MyFrom

Set MyForm = Nothing



*) Avoid the 'Dim [...] as NEW'



*) Ensure all objects have correctly terminated

Use reference counters in the _Initialize and _Terminate events. Check

these

reference counters.



*) 3rd party ActiveX-Controls



Also ensure you have the newest VB Service pack



Robert









"Bruce Baker" <bruceb@ardex.com.au>wrote in message

news:%237Ta%230SbEHA.2520@TK2MSFTNGP12.phx.gbl...

>Are there any good tools to help diagnose resource / memory leaks in VB

6

>apps ?

>

>Thnks

>Bruce

>

>









-

Re:Locating resource leaks

Robert top-posted:

< snip>



Quote
Also ensure you have the newest VB Service pack



Not so sure SP6 is a good idea, unless you are suffering from a specific

problem it fixes vs SP5.



Austin



-

Re:Locating resource leaks

On Wed, 21 Jul 2004 13:36:54 GMT, "AustinMN" <tacooperX@Xatt.net>

wrote:



Quote
Robert top-posted:

< snip>



>Also ensure you have the newest VB Service pack



Not so sure SP6 is a good idea, unless you are suffering from a specific

problem it fixes vs SP5.



Or you fancy spending a long time removing SP6 (?!)

-