Freeing Memory
-
I heard that resource(memory) is freed automatically for you in vb.net but not vb6, so i was wondering how do you do it manually in vb6 ?
Set MyObject = Nothing
Paul I think there're pieces of me you've never seen - Tori Amos, Tear in Your Hand -
Set MyObject = Nothing
Paul I think there're pieces of me you've never seen - Tori Amos, Tear in Your HandSetting an Object = Nothing does not ALWAYS free the memory in VB6 (this goes for .NET as well). Get familiar with the Objects you are using, if they implement a "Close" or "Dispose" method, ALWAYS use it before Setting your Object = Nothing. For example, watch ADO eat up memory in a VB6 app. However, when you use the Close method, the memory usage goes way down. It takes a little while for the VB6 runtime to clean up the memory references, but it happens.