Re: Different between ???.close and Set ??? = Nothing
From: augustus (augustus_at_discussions.microsoft.com)
Date: 09/28/04
- Next message: Paul Schrader: "Providing Logon info for a Linked Table use Db2 in Access"
- Previous message: CLM: "Access 2002 execute dts package on SQL Server 2000"
- In reply to: Jamie Collins: "Re: Different between ???.close and Set ??? = Nothing"
- Next in thread: Dirk Goldgar: "Re: Different between ???.close and Set ??? = Nothing"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Sep 2004 16:45:02 -0700
In the VBA IDE I always use the Toggle Breakpoint to test code, and I
frequently use it to stop the execution of code whenever I found a error.
Therefore, code never got a completed.
Would the garbage collector collect those objects or variables that got
referenced?
Is there way I could find RAM that locked up as the result of not freeing
resources (variables) up preoperly?
Thanks
"Jamie Collins" wrote:
> "Joe Fallon" wrote ...
>
> > The point of Nothing is to remove the reference to your object so it the RAM
> > can be freed up.
>
> If the object variable merely a pointer (reference) you'll only be
> releasing 4 bytes and I've yet to see code that sets explicitly
> empties all Long variables <g>. More importantly, though, you'll be
> decreasing the reference count so the actual object may be released
> (if this doesn't happen you'll get a memory leak). However, it is rare
> that an object variable needs to be explicitly set to nothing; simply
> let it go out of scope and let the garbage collector do its work. If
> you always set object variables to Nothing you risk obscuring the code
> that *needs* to set object variables to Nothing e.g. explicit teardown
> code to resolve circular references.
>
> Jamie.
>
> --
>
- Next message: Paul Schrader: "Providing Logon info for a Linked Table use Db2 in Access"
- Previous message: CLM: "Access 2002 execute dts package on SQL Server 2000"
- In reply to: Jamie Collins: "Re: Different between ???.close and Set ??? = Nothing"
- Next in thread: Dirk Goldgar: "Re: Different between ???.close and Set ??? = Nothing"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|