.NET

Reply
Contributor
dbaranas
Posts: 14
Registered: ‎01-23-2006
Message 1 of 3 (322 Views)

fixing VBA memory leak problem

322 Views, 2 Replies
06-08-2006 05:33 PM
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.
*J. Daniel Smith
Message 2 of 3 (322 Views)

Re: fixing VBA memory leak problem

06-09-2006 05:56 AM 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.
*Stuart Nathan
Message 3 of 3 (322 Views)

Re: fixing VBA memory leak problem

06-09-2006 10:33 AM in reply to: dbaranas
you might try object.dispose
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.