> The sad thing is this pretty much means that Allaire is 
> admitting that the memory model in CF needs serious work. 
> I'm paraphrasing of course ;) The way CF deals with memory 
> in general is pretty weak. "Restart the service to release 
> unused memory" is not my idea of an acceptable policy. As 
> it's been explained to me by various people, including some 
> Allaire folks, the memory model is also the source of the 
> problems associated with not having an OnSessionTimeout or 
> OnSessionEnd function/template. Basically, the server doesn't 
> "know" when a session ends. It looks at the timeout parameter 
> of each session and simply makes the ones that are past the 
> current time inaccessible, or, I should say, refuses to read 
> them. From what I've been told, the information still exists 
> in memory until it is overwritten by new information. Has 
> anyone tried using low-level diagnostics to see if they can
> access session information that has expired, i.e. test whether 
> the information truly remains until overwritten? Don't anyone 
> go writing a CFX that allows you to do this, if it's possible. 
> That would be too cool and might make Allaire look bad ;)

I'd like to differ slightly from your conclusion.

In CF 4.5.x, the memory model changed so that CF would no longer release any
memory that the service acquired. This actually was a change in the
third-party memory manager, SmartHeap, used by CF. It doesn't matter whether
the memory is consumed with session variables, cached queries, or whatever -
CF simply won't release it. Whether the original information is still stored
in memory or not doesn't really matter, as long as it's marked for deletion.

The justification for this behavior is that CF is designed to be the
"dominant" service on a box, and thus should be the only service consuming
any serious resources - the typical NT deployment model of one service per
machine. By holding on to acquired memory, CF can avoid the relatively
significant costs involved in releasing and reacquiring memory. As long as
the CF service can reuse the memory previously acquired, then there
shouldn't be any problems.

The real problem comes in when you have a component which causes a memory
leak. For example, a while back I found that the Oracle client library in
use on a specific server had a severe memory leak. Because of this, CF would
continually consume more memory, even though it had already acquired enough
to perform a repetition of previous activity. Eventually, the server would
run out of memory and crash. However, if you have an environment without
memory leaks, CF's behavior isn't necessarily unreliable or weak. It simply
assumes that everything else (outside of CF) is in perfect working order.

Personally, given the likelihood of memory problems in ODBC components and
other things, I'd prefer that CF used the "release and reacquire" process as
it did prior to 4.5.x. However, this isn't a "weak" memory model - it's
simply a prioritization of performance over stability. Throughout the
history of the CF product, Allaire has always favored performance over
stability whenever the two may conflict.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to