At 02:56 PM 7/13/2004, you wrote:

 I do know that if I make a change to the CFC file, the person has to log out then log back in to see the change, which hints at a potentially larger than expected RAM usage and object instantiation time because of the use of CFCs.

 It is true that CFC changes will not be reflected in already created persistent variables.  The variables (in this case a component instance) will have to be re-created.  This is the case of all variables stored in the session scope.
 I'm not sure how this hints ad larger than expected RAM usage.  I do not expect you'll be making changes too often in a production environment.

Here is how it hints at larger RAM usage: <scenario>User 1 logs in and gets a CFC instance. One of the functions is changed in the CFC and the file is saved. User 2 logs in and gets a CFC instance.</scenario> In the scenario, user 1 would continue to get the old function until he logs out, while user 2 would get the new function. While I realize the function will not actually change in production, this behavior suggests that ColdFusion is keeping track of both functions somehow, presumably in RAM. So lets say 10,000 sessions are open at once, which is very reasonable for this application. That means that 10,000 copies of every function that is in the CFC now reside in RAM, even though every function is identical. Let say the functions inside of a CFC take up 20 KB of RAM (around 400 lines of code). The use of CFCs would take up 20 KB X 10,000 = 200 MB (approx.) to store identical functions! Not only that, but the time it takes to load and unload these function surely slows down instantiate and log out time. With custom tags and cfincludes, there is only every one instance of the function. A custom tag, on the other hand, would take 20 KB X 1 = 20 KB of RAM.

 I understand what you're saying.  Wild thoughts.
 As part of CFs "parsing / caching" algorithm it saves class files (for both cfm and cfcs I believe) on the hard disc.  It would be my expectation that the "class file" is stored in the cache on disc, not in memory. 

 However, I thought that when the file changed, the cache was "re-compiled", so I'm not sure how it would handle two versions of the file being actively used. 

--
Jeffry Houser, Web Developer, Writer, Songwriter, Recording Engineer
<mailto:[EMAIL PROTECTED]>
--
AIM: Reboog711  | Phone: 1-203-379-0773
--
My Books: <http://www.instantcoldfusion.com>
Recording Music: <http://www.fcfstudios.com>
Original Energetic Acoustic Rock: <http://www.farcryfly.com>

Reply via email to