REALbasic manages memory for objects via a technique known as
"reference counting," as does Visual Basic (prior to VB.NET). In this
system, an object is deleted immediately when there are no more
references to it. This is different from the system used by VB.NET,
which is "garbage collection" -- in that system, objects are not
deleting immediately, but later, when a garbage collector notices that
they are no longer in use. These garbage collection passes can
sometimes be quite expensive, causing significant pauses in your
application at intervals which are hard to predict. Reference counting
sometimes requires a little more care -- in particular, you must watch
out for reference loops which prevent a set of objects from being
destroyed -- but it produces more even and predictable performance.
For more information on reference counting and for an example of a
circular reference, see the REALbasic User's Guide.
This tip was provided by Joe Strout.
--
Geoff Perlman
President and CEO
REAL Software, Inc.
512-328-7325 x711 (voice)
512-328-7372 (fax)
- - - - - - - - - -
Got a useful tip to share? Send it to us at:
<REALbasic-tips at lists dot realsoftware dot com>
Click here to unsubscribe:
<http://support.realsoftware.com/listmanager/>
|