<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Memory-sensitive Caching for CF</title>
	<atom:link href="http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/</link>
	<description>Music, Politics and Code</description>
	<pubDate>Sat, 26 Jul 2008 02:57:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: John Allen</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-1604</link>
		<dc:creator>John Allen</dc:creator>
		<pubDate>Tue, 10 Jun 2008 00:56:13 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-1604</guid>
		<description>DUDE! THIS SAVES MY DAY/MONTH!!!!
Thank you.
John Allen</description>
		<content:encoded><![CDATA[<p>DUDE! THIS SAVES MY DAY/MONTH!!!!<br />
Thank you.<br />
John Allen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashwin</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-23</link>
		<dc:creator>Ashwin</dc:creator>
		<pubDate>Tue, 27 Mar 2007 09:58:50 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-23</guid>
		<description>Hendrik - softcache.cfc does not touch the data put into it at all, so you should be getting it back unchanged. I'm sorry, but I'm really not sure what the root of your particular problem might be.</description>
		<content:encoded><![CDATA[<p>Hendrik - softcache.cfc does not touch the data put into it at all, so you should be getting it back unchanged. I&#8217;m sorry, but I&#8217;m really not sure what the root of your particular problem might be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hendrik</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-22</link>
		<dc:creator>Hendrik</dc:creator>
		<pubDate>Tue, 27 Mar 2007 09:35:39 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-22</guid>
		<description>By using the softcache.cfc, i've noticed the same behaviour of returning corrupted copies of large structures as with the duplicate() function before ColdFusion 7.02 with is fixed with the Cumulative Hot Fix 1 ( see http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb400074 ID #63910 ). Any clues? Or do i have to wddx the structure first to ensure that it's correctly returned?</description>
		<content:encoded><![CDATA[<p>By using the softcache.cfc, i&#8217;ve noticed the same behaviour of returning corrupted copies of large structures as with the duplicate() function before ColdFusion 7.02 with is fixed with the Cumulative Hot Fix 1 ( see <a href="http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb400074" rel="nofollow">http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb400074</a> ID #63910 ). Any clues? Or do i have to wddx the structure first to ensure that it&#8217;s correctly returned?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashwin</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-21</link>
		<dc:creator>Ashwin</dc:creator>
		<pubDate>Thu, 22 Mar 2007 05:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-21</guid>
		<description>Jerad - thanks for pointing that out. Yet another victim of an abortive software upgrade attempt a couple of weeks ago! The link is fixed now.</description>
		<content:encoded><![CDATA[<p>Jerad - thanks for pointing that out. Yet another victim of an abortive software upgrade attempt a couple of weeks ago! The link is fixed now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hungry</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-20</link>
		<dc:creator>hungry</dc:creator>
		<pubDate>Wed, 21 Mar 2007 21:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-20</guid>
		<description>the link to softcache.cfc seems to be down...is it still possible to get it?

thanks,
jerad</description>
		<content:encoded><![CDATA[<p>the link to softcache.cfc seems to be down&#8230;is it still possible to get it?</p>
<p>thanks,<br />
jerad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Mandel</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-19</link>
		<dc:creator>Mark Mandel</dc:creator>
		<pubDate>Fri, 16 Feb 2007 01:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-19</guid>
		<description>Ashwin -

Since the SoftReference is created inside a CFC, which is a singleton, I would then assume that it is for the classLoader that loads and handles that CFC (because a CFC is just another template, is it not?)

As long as the CFC is resident in a shared scope, the ClassLoader for it won't be thrown away, I would have thought.

My issue was more actually that the SoftReference at the CF layer were being cleared, but the ones at the URLCLassLoader layer weren't.

To get around this issue I'm simply creating one softReference for each object I want to let the JVM clear() as required, and passing that around my system. That was it doesn't actually matter who/what clears() it - once it is cleared, nothing has a reference to it.

Ahhhh complex caching fun :oD</description>
		<content:encoded><![CDATA[<p>Ashwin -</p>
<p>Since the SoftReference is created inside a CFC, which is a singleton, I would then assume that it is for the classLoader that loads and handles that CFC (because a CFC is just another template, is it not?)</p>
<p>As long as the CFC is resident in a shared scope, the ClassLoader for it won&#8217;t be thrown away, I would have thought.</p>
<p>My issue was more actually that the SoftReference at the CF layer were being cleared, but the ones at the URLCLassLoader layer weren&#8217;t.</p>
<p>To get around this issue I&#8217;m simply creating one softReference for each object I want to let the JVM clear() as required, and passing that around my system. That was it doesn&#8217;t actually matter who/what clears() it - once it is cleared, nothing has a reference to it.</p>
<p>Ahhhh complex caching fun :oD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashwin</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-18</link>
		<dc:creator>ashwin</dc:creator>
		<pubDate>Thu, 15 Feb 2007 06:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-18</guid>
		<description>Hmmm... One thing to keep in mind, perhaps, is that your URLClassLoader is probably a child classloader to the classloader for the template on which it is used. When the template changes, the template's classloader is thrown away (this is how CF handles hot deployment of templates, but that's a subject for a blog entry, coming soon!), which may be another reason for the CFC SoftReference loaded by the URLClassLoader being thrown away, but not the one loaded by the CF classloader.</description>
		<content:encoded><![CDATA[<p>Hmmm&#8230; One thing to keep in mind, perhaps, is that your URLClassLoader is probably a child classloader to the classloader for the template on which it is used. When the template changes, the template&#8217;s classloader is thrown away (this is how CF handles hot deployment of templates, but that&#8217;s a subject for a blog entry, coming soon!), which may be another reason for the CFC SoftReference loaded by the URLClassLoader being thrown away, but not the one loaded by the CF classloader.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Mandel</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-17</link>
		<dc:creator>Mark Mandel</dc:creator>
		<pubDate>Thu, 15 Feb 2007 04:07:44 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-17</guid>
		<description>Actually Ashwin, I believe that my issue was caused by the fact I had some SoftReferences being created on my ColdFusion ClassLoader, and some being loaded on my URLClassLoader (JavaLoader to be exact), which I believe allowed the JVM to gc one set, but not the other.

Thanks for the great article.</description>
		<content:encoded><![CDATA[<p>Actually Ashwin, I believe that my issue was caused by the fact I had some SoftReferences being created on my ColdFusion ClassLoader, and some being loaded on my URLClassLoader (JavaLoader to be exact), which I believe allowed the JVM to gc one set, but not the other.</p>
<p>Thanks for the great article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Mandel</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-16</link>
		<dc:creator>Mark Mandel</dc:creator>
		<pubDate>Thu, 15 Feb 2007 02:07:35 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-16</guid>
		<description>Ashwin,

I based my caching layer in Transfer around soft references to help with memory management, but something very strange seems to be happening -

I have 2 soft references pointing to the same CFC, and it seems that one is getting collected, while the other one isn't.

This doesn't seem to make any sense, as if one is collected by the garbage collector, so should the other.  I'm wondering if there is something to the nature of CFCs that would allow that?

Looking at my debug code as well, it almost seems to be that there is no strong reference between CFCs and any sub-CFCs they hold within them.

Any help there at all?

Mark</description>
		<content:encoded><![CDATA[<p>Ashwin,</p>
<p>I based my caching layer in Transfer around soft references to help with memory management, but something very strange seems to be happening -</p>
<p>I have 2 soft references pointing to the same CFC, and it seems that one is getting collected, while the other one isn&#8217;t.</p>
<p>This doesn&#8217;t seem to make any sense, as if one is collected by the garbage collector, so should the other.  I&#8217;m wondering if there is something to the nature of CFCs that would allow that?</p>
<p>Looking at my debug code as well, it almost seems to be that there is no strong reference between CFCs and any sub-CFCs they hold within them.</p>
<p>Any help there at all?</p>
<p>Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashwin</title>
		<link>http://blogs.sanmathi.org/ashwin/2006/07/01/memory-sensitive-caching-for-cf/#comment-15</link>
		<dc:creator>ashwin</dc:creator>
		<pubDate>Thu, 01 Feb 2007 10:41:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sanmathi.org/ashwin/?p=29#comment-15</guid>
		<description>I haven't tried it at all with the server monitor, Charlie. The results should be the same, since the server monitor uses the same JVM APIs to get overall JVM memory consumption data. The CF-specific memory tracking that the server monitor provides will not work with softcache.cfc, since the references to the CF objects are wrapped in Java SoftReference objects. CF memory tracking relies on being able to traverse a graph of CFML object references, estimating the memory consumed by each. Any Java objects are not tracked, since there is no way to determine the actual size of a Java object at runtime without turning on debugging on the JVM (requiring a server restart and a big performance hit), which we wanted to avoid.

Give it a go; if you have any issues, let me know, and I'll be happy to work through them with you.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t tried it at all with the server monitor, Charlie. The results should be the same, since the server monitor uses the same JVM APIs to get overall JVM memory consumption data. The CF-specific memory tracking that the server monitor provides will not work with softcache.cfc, since the references to the CF objects are wrapped in Java SoftReference objects. CF memory tracking relies on being able to traverse a graph of CFML object references, estimating the memory consumed by each. Any Java objects are not tracked, since there is no way to determine the actual size of a Java object at runtime without turning on debugging on the JVM (requiring a server restart and a big performance hit), which we wanted to avoid.</p>
<p>Give it a go; if you have any issues, let me know, and I&#8217;ll be happy to work through them with you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
