.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fixing VBA memory leak problem

2 REPLIES 2
Reply
Message 1 of 3
dbaranas
566 Views, 2 Replies

fixing VBA memory leak problem

I have written an app in VBA that could be finished except for the seemingly unsolvable memory leaks that are inherent in VBA.

I am hoping to migrate everything into VB.NET and want to take a look down this road so I do not smash into another wall.

I have done all the good cleanup practices in my code but I still watch task manager inflate until the inevitable fatal crash that will always happen when working with thousands of entities, selection sets, etc.

I am wondering if in .NET .....objects, collections, and arrays will be released from memory when set to nothing as is the promise of the NET framework. So far in this group there is hardly any mention of the memory leak problems that have been asked in the VBA group that but have not been really adressed with real solutions.

I wonder if making a standalone VB.NET app can over come this problem or should it be a hybrid windows.form exe calling a dll.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: dbaranas

The short answer is "no", .NET will not release objects from memory when
they are set to Nothing (null); and .NET makes no such promises to do so.

That being said, garbage collection generally works quite well in .NET and
most objects that have strict resource-release requirements implement
IDisposable. Furthermore, there are some GC utility routines which allow
you force garbage collection to take place should that be absolutely
necessary.

Dan

wrote in message news:5200753@discussion.autodesk.com...
I have written an app in VBA that could be finished except for the seemingly
unsolvable memory leaks that are inherent in VBA.

I am hoping to migrate everything into VB.NET and want to take a look down
this road so I do not smash into another wall.

I have done all the good cleanup practices in my code but I still watch task
manager inflate until the inevitable fatal crash that will always happen
when working with thousands of entities, selection sets, etc.

I am wondering if in .NET .....objects, collections, and arrays will be
released from memory when set to nothing as is the promise of the NET
framework. So far in this group there is hardly any mention of the memory
leak problems that have been asked in the VBA group that but have not been
really adressed with real solutions.

I wonder if making a standalone VB.NET app can over come this problem or
should it be a hybrid windows.form exe calling a dll.
Message 3 of 3
Anonymous
in reply to: dbaranas

you might try object.dispose

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost