Now that is a very profound way of putting it.

Well, this deals with the issues I had with how cfinvoke and other
tags were described as working. Now I just have to say it right. Fun.
:)

So the question now is if GC can be called programatically after all
references to a large 'object' is removed during a single request.
That'll have to be for another time when I don't have a chapter to
finish. :)

> The query itself, as an object on the heap, is never actually in the
> function's local scope. Objects on the heap don't really have a scope.
> References do, and the reference to that query that's declared in the
> function's will be marked for deletion when the function finishes. The
> query object itself will be marked for deletion when there are no more
> references pointing to it.
>
>> > References exist on the stack; the objects being referenced
>> > exist in the heap.
>>
>> Can you expand a bit on what you're saying here?
>
> Sure. If you create a query:
>
> <cfquery name="foo" ...>
> ...
> </cfquery>
>
> what's actually happening there is that you've created two things -
> the query itself, which is just an object with some stuff in it, and a
> reference to that object, "foo".
>
> So, then you do something like this:
>
> <cfset bar = foo>
>
> Now, you still have one query object, but two references to that
> object: foo and bar.
>
> Next, you do something like this:
>
> <cfset structDelete(variables, "foo")>
>
> Now, you still have the original query object, but only one reference
> to it: bar. Since all this is happening in the span of a single page
> request, it won't likely make any difference in memory consumption,
> but you could just as easily create references in the Session,
> Application or Server scopes and things would work the same way.
>
> This concept of references on the stack vs objects in the heap is
> common in many modern languages. Here's a description from the "Java
> for ColdFusion Developers" book that came out a few years ago:
>
> http://www.informit.com/articles/article.aspx?p=31755&seqNum=8
>
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> http://training.figleaf.com/
>
> Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
> GSA Schedule, and provides the highest caliber vendor-authorized
> instruction at our training centers, online, or onsite.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331526
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to