<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Mike Schierberl&apos;s Blog</title>
			<link>http://www.schierberl.com/cfblog/index.cfm</link>
			<description>Mike Schierberl&apos;s thoughts on software development and coldfusion</description>
			<language>en-us</language>
			<pubDate>Sun, 05 Sep 2010 12:06:45 -0700</pubDate>
			<lastBuildDate>Mon, 27 Jul 2009 22:29:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>mike@schierberl.com</managingEditor>
			<webMaster>mike@schierberl.com</webMaster>
			
			
			
			
			
			<item>
				<title>varScoper 1.30 release with CF Builder extension</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2009/7/27/varScoper-130-release-with-CF-Builder-extension</link>
				<description>
				
				varScoper 1.30 is now available to &lt;a href=&quot;http://varscoper.riaforge.org/index.cfm?event=action.download&quot;&gt;download on RIAForge&lt;/a&gt;.  This release fixes over 17 reported issues and also works properly on both Railo and OpenBD.

Additionally, &lt;a href=&quot;http://www.coldfusionjedi.com&quot;&gt;Raymond Camden&apos;s&lt;/a&gt; ColdFusion builder extension code has been integrated.  Hopefully the consolidation will make life easier for everyone. You can either install the zip, or import the extension if it&apos;s already unpacked.  In case you haven&apos;t used it yet, this feature allows you to right click on a file or folder in CF Builder and run varScoper directly from the IDE.

At the moment, this release will not correctly identify variables based on CF9 syntax (LOCAL scope and ability to identify var anywhere in a function).  The test cases are in place and I&apos;ll be working on it soon.  As a result you will notice the unit test will throw an error if you aren&apos;t running cf9.

Thanks again to Ray, Pat Santora, and everyone else who has reported issues.  If you have any problems, please &lt;a href=&quot;http://varscoper.riaforge.org/index.cfm?event=page.issues&quot;&gt;report them at RIAForge&lt;/a&gt; and I will get to them eventually.
				
				</description>
						
				
				<category>varScoper</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Mon, 27 Jul 2009 22:29:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2009/7/27/varScoper-130-release-with-CF-Builder-extension</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>I&apos;ll be at webdu on Thurs/Fri</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2009/5/18/Ill-be-at-webdu-on-ThursFri</link>
				<description>
				
				&lt;img src=&quot;/mike.jpg&quot; width=&quot;120&quot; border=&quot;0&quot; align=&quot;left&quot; style=&quot;margin-right: 10px;&quot; /&gt;
I&apos;m excited to say that I&apos;ll be attending &lt;a href=&quot;http://www.webdu.com.au/&quot;&gt;webdu&lt;/a&gt; here in Sydney on Thursday and Friday this week.  Looking forward to an impressive lineup of speakers.&lt;br&gt;&lt;br&gt; I&apos;m new to Sydney, so please don&apos;t be a stranger and introduce yourself, here&apos;s a picture of what I look like.   &lt;Br&gt;&lt;br&gt;Also, I just found out about &lt;a href=&quot;http://www.webdu.com.au/session/code-wars&quot;&gt;code-wars&lt;/a&gt; as well, not sure what to make of it, but sounds like a blast, I&apos;ll see you there.
				
				</description>
						
				
				<category>other</category>				
				
				<pubDate>Mon, 18 May 2009 15:34:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2009/5/18/Ill-be-at-webdu-on-ThursFri</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Moving to Sydney</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2009/5/6/Moving-to-Sydney</link>
				<description>
				
				At 10:30pm tonight I will be getting on a plane to relocate to Sydney, Australia.  The bags are packed, and I&apos;m looking forward to the next exciting chapter in my life.  As of Monday, my company was acquired by Thomson Reuters, and I will be working as an independent consultant for them.&lt;br&gt;&lt;br&gt;

I&apos;m looking forward to getting involve with all of you in the CF community when I arrive.  Don&apos;t be a stranger, please introduce yourselves as I hardly know anyone there.  I&apos;m really hoping that I can win a pass to &lt;a href=&quot;http://twitter.com/webdu&quot;&gt;@webdu&lt;/a&gt; in their twitter competition, it would be a great opportunity to make some connections.  If you&apos;re on twitter I wouldn&apos;t mind a shameless plug for a ticket :) (&lt;a href=&quot;http://twitter.com/mikeschierberl&quot;&gt;@mikeschierberl&lt;/a&gt;).&lt;br&gt;&lt;br&gt;

Additionally, if you are in Sydney, I&apos;d love recommendations on things to do/see from a locals perspective.  I&apos;ve been there a few times, but I will be coming with a clean slate and an open mind.
				
				</description>
						
				
				<category>other</category>				
				
				<pubDate>Wed, 06 May 2009 14:20:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2009/5/6/Moving-to-Sydney</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Deploying cached CSS and JS with Ant</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2009/2/9/Deploying-CSS-and-JS-with-ant</link>
				<description>
				
				If you are using &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot;&gt;YSlow&lt;/a&gt; or an equivalent tool you&apos;re probably aware of some of the best practices to follow to optimize client-side load times.  In this post I&apos;m going to outline a quick and easy approach that we use at &lt;a href=&quot;http://www.planitax.com&quot;&gt;Planitax&lt;/a&gt; to deploy static content using Ant.

The best practices that I hope to address with this build strategy are...&lt;br&gt;
1) &lt;a href=&quot;http://developer.yahoo.com/performance/rules.html#expires&quot;&gt;Add an Expires or a Cache-Control Header&lt;/a&gt;&lt;br&gt;
2) &lt;a href=&quot;http://developer.yahoo.com/performance/rules.html#minify&quot;&gt;Minify JavaScript and CSS&lt;/a&gt;

Both of these are pretty straightforward, but it&apos;s easy to run into problems when deploying updates to content that might have an expire date in the future.  You might run into this problem when you make changes to js, css, or images in your application.  If a browser has cached content locally, the user might see stale images, or worse yet experience errors due to out of date javascript or css files.

When we developed a deployment strategy we wanted an approach that was transparent to the end user, easy to build, and had minimal impact on developers checking in code. We needed to meet the following criteria.  
&lt;ul&gt;
   &lt;li&gt;Content should be able to have a Expire date at any point in the future
   &lt;li&gt;Content can be deployed to QA/Production at any time using a one step build
   &lt;li&gt;Webserver should automatically apply expires headers to static assets without additional deployment steps.
   &lt;li&gt;Developers should always be able to check into a single repository location. Branching/Deploying should not require a copy of a file to be checked in.
   &lt;li&gt;Developers should not be required to run a build target in order to see changes to static content.
   &lt;li&gt;js/css should be minified on production deployments, but not in the source code repository.
&lt;/ul&gt;

&lt;br&gt;
From these requirements we came up with a strategy that looked something like this.
&lt;ul&gt;
&lt;li&gt;Static assets that can be cached will always live in the /assets folder off the application root.  Content will be organized into subfolders for /assets/js, /assets/css, and /assets/images.
&lt;li&gt;Developers will work with expires headers turned off for these folders so changes will appear immediately.
&lt;li&gt;Developers will check files in directly to this location.  The repository location will always be /assets.
&lt;li&gt;When deploying to QA/Production, a copy of the static assets will be created with a new version identifier.  This copy will also be minified as part of the deploy step.
&lt;li&gt;The application will be able to determine the correct copy of static content to use regardless of the deployment environment.
&lt;li&gt;QA/Production web servers will automatically add an expires header to any content located in the /assets folder.
&lt;/ul&gt;

The first step was to build an ant target that would take care of creating a new folder, copying the assets and minifying content appropriately. We use &lt;a href=&quot;http://crockford.com/javascript/jsmin&quot;&gt;JSMin&lt;/a&gt; to minify our JS. In order to execute this example you will need to &lt;a href=&quot;http://code.google.com/p/jsmin-ant-task/&quot;&gt;download the JSMin Ant Task from Google Code&lt;/a&gt;.  Note, when setting up your taskdef, the classpath attribute should point to the relative location that you have saved the .jar file.  For this example it will be in the /lib subfolder off of root. 

&lt;code&gt;
&lt;taskdef name=&quot;jsmin&quot; classname=&quot;net.matthaynes.jsmin.JSMin_Task&quot; classpath=&quot;./lib/jsmin.0.2.3.jar&quot; /&gt;

	&lt;target name=&quot;jsmin&quot;&gt;
                &lt;!-- tstamp creates variables for date and time of current execution --&gt;
		&lt;tstamp /&gt;
		&lt;copy todir=&quot;./assets/js${DSTAMP}${TSTAMP}&quot; includeEmptyDirs=&quot;true&quot; preservelastmodified=&quot;true&quot; overwrite=&quot;false&quot; failonerror=&quot;true&quot; verbose=&quot;true&quot;&gt;
			&lt;fileset dir=&quot;./assets/js&quot;&gt;
				&lt;include name=&quot;**/*.*&quot; /&gt;
			&lt;/fileset&gt;
		&lt;/copy&gt;
		&lt;jsmin destdir=&quot;./assets/js${DSTAMP}${TSTAMP}&quot; force=&quot;true&quot;&gt;
			&lt;fileset dir=&quot;./assets/js&quot; includes=&quot;*.js&quot; /&gt;
		&lt;/jsmin&gt;
	&lt;/target&gt;
&lt;/code&gt;

This code creates a folder with a name that looks something like this... ./assets/js200901141546 , it&apos;s named this way so we can do alpha sorts easily as you will see in the next step.  We don&apos;t check this folder in to source control.

Note: You can adapt this code for css or images by modifying the copy command, if you only need to copy/minify JS you might be able to get by without the copy command.

The next step is to make your application aware of the correct folder to be used.  This is easy to do with a cfdirectory based on the naming convention we used above.  First we will create a variable that identifies the most recent/current folder created by the name that contains the timestamp.  The nice thing about this is that it will identify the correct folder for prod servers as well as developers who only have a ./assets/js folders.  It does not require developers to run the build target in order to see changes.

&lt;code&gt;
&lt;cfdirectory 
			action=&quot;list&quot; 
			directory=&quot;#expandPath(&apos;./assets/&apos;)#&quot; 
			name=&quot;jsDirectoryList&quot; 
			filter=&quot;js*&quot;
			sort=&quot;name desc&quot; &gt;
			
&lt;cfset application.jsAssetsSubFolder = jsDirectoryList.name&gt;
&lt;/code&gt;

The only tricky part is to make sure that all your links to assets include the new variable that you have created.  Your links will look something like this...

&lt;code&gt;
&lt;cfoutput&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;./assets/#application.jsAssetsSubFolder#/script.js&quot;&gt;&lt;/script&gt;
&lt;/cfoutput&gt;
&lt;/code&gt; 

I&apos;m sure there are countless ways to approach this, and your deployment strategy may differ significantly based on your environment, and or application.  I&apos;m interested to see how others have approached this and other deployment tasks.
				
				</description>
						
				
				<category>coldfusion</category>				
				
				<category>ant</category>				
				
				<pubDate>Mon, 09 Feb 2009 14:49:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2009/2/9/Deploying-CSS-and-JS-with-ant</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Thread safety and the var scope - live example</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2008/7/21/Thread-safety-and-the-var-scope--live-example</link>
				<description>
				
				Recently, I&apos;ve talked to a few developers who knew about the var scope, but didn&apos;t quite grasp the concept of making a variable local to a function.  Additionally, I&apos;ve come across a few posts that indicated that setting a var statement was strictly to conserve memory (along with other reasons that missed the point). 

To help anyone struggling with understanding the impact of the var scope I&apos;ve put together a quick example to demonstrate what can happen when you improperly scope a variable.

The example here focuses on CFCs that are loaded into a shared scope (session, application, etc), and are accessed simultaneously by multiple users.Running the code will make 2 simultaneous requests to the same function in separate iframes. The example contains a loop that outputs the index of a loop from 1 to 100.  If the loop executes correctly the numbers appear in green, if the numbers are out of sequence, they will be red.  To make the results more dramatic I&apos;ve included a 1-40ms pause in each loop iteration.

&lt;a href=&quot;javascript:goTest(&apos;var&apos;);&quot;&gt;run example with var statement&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;javascript:goTest(&apos;nonVar&apos;);&quot;&gt;run example without var statement&lt;/a&gt;&lt;br&gt;
&lt;table border=&quot;0&quot;&gt;
	&lt;tr&gt;
		&lt;td width=&quot;50%&quot;&gt;&lt;iframe src=&quot;/cfblog/threadExample/blank.html&quot; border=&quot;0&quot; height=&quot;175&quot; width=&quot;100%&quot; name=&quot;leftFrame&quot;&gt;&lt;/iframe&gt;&lt;/td&gt;
		&lt;td width=&quot;50%&quot;&gt;&lt;iframe src=&quot;/cfblog/threadExample/blank.html&quot; border=&quot;0&quot; height=&quot;175&quot; width=&quot;100%&quot; name=&quot;rightFrame&quot;&gt;&lt;/iframe&gt;&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

Here&apos;s the cfc that is loaded in server scope (simplified for reading).  Note the only difference in the functions is that the &quot;count&quot; variable has a var statement in one function and doesn&apos;t in the other function.

&lt;code&gt;
&lt;cfcomponent name=&quot;thread&quot;&gt;
	
	&lt;cffunction name=&quot;nonVarFunction&quot; &gt;
		&lt;cfset var lastCount = 0&gt;
		&lt;cfset var idx = 0&gt;
		
		&lt;cfset count = 0&gt;
		
		executing &quot;nonVarFunction()&quot;&lt;br/&gt;
		
		&lt;cfloop from=&quot;1&quot; to=&quot;100&quot; index=&quot;idx&quot;&gt;
			&lt;cfset lastCount = count&gt;
			&lt;cfset count = count + 1&gt;
			&lt;cfthread action=&quot;sleep&quot; duration=&quot;#randRange(1,40)#&quot; /&gt;
			&lt;cfoutput&gt;
				&lt;cfif count-1 EQ lastCount&gt;
				   &lt;!--- display green---&gt;
				   #count#
				&lt;cfelse&gt;
				   &lt;!--- display red---&gt;
				   #count#
				&lt;/cfif&gt;
			&lt;/cfoutput&gt;
			&lt;cfflush&gt;
		&lt;/cfloop&gt;
	&lt;/cffunction&gt;
	
	&lt;cffunction name=&quot;VarFunction&quot; &gt;
		&lt;cfset var lastCount = 0&gt;
		&lt;cfset var idx = 0&gt;
		
		&lt;cfset var count = 0&gt;
		
		executing &quot;VarFunction()&quot;&lt;br/&gt;
		
		&lt;cfloop from=&quot;1&quot; to=&quot;100&quot; index=&quot;idx&quot;&gt;
			&lt;cfset lastCount = count&gt;
			&lt;cfset count = count + 1&gt;
			&lt;cfthread action=&quot;sleep&quot; duration=&quot;#randRange(1,40)#&quot; /&gt;
			&lt;cfoutput&gt;
				&lt;cfif count-1 EQ lastCount&gt;
				   &lt;!--- display green---&gt;
				   #count#
				&lt;cfelse&gt;
				   &lt;!--- display red---&gt;
				   #count#
				&lt;/cfif&gt;
			&lt;/cfoutput&gt;
			&lt;cfflush&gt;
		&lt;/cfloop&gt;
	&lt;/cffunction&gt;
&lt;/cfcomponent&gt;
&lt;/code&gt;

What happened?

If the example executed correctly, you should have seen all green numbers in both windows for the var scope example, and a mix of green and red in the example that executed the function without the var statement.  The presence of the &quot;var&quot; statement makes the variable local to the function.  This means that when the function runs, it creates a new instance of the variable that is unique each time the function is executed.  Without the var statement in place, the variable gets &quot;shared&quot; between everyone who is accessing this component.  When a component lives in a shared scope (session, application) the variable will be shared for everyone accessing that scope.  Think of the following scenario.

User 1: set count = 1&lt;br/&gt;
User 2: set count = 1&lt;br/&gt;
User 1: set count = count + 1&lt;br/&gt;
User 2: set count = count + 1&lt;br/&gt;
User 1: count = 2&lt;br/&gt;
User 2: count = 3&lt;br/&gt;

In this case the developer most likely intended to have both users see count = 2, however the variable was shared and as a result a user&apos;s result was impacted by another user&apos;s request.  Note: this may be the intended behavior of the code, and that&apos;s why there is no definite rule on why you should &quot;always&quot; or &quot;never&quot; var scope a variable.

Unfortunately, recognizing issues that appear as a result of improper scope can be difficult.  Many times they result in server errors that are intermittent and only appear under load.  This can sometimes make it practically impossible to reproduce the error in a test environment.  Also, many tags create variables that are easy to miss (cfquery, cfloop, etc).  

Luckily, there&apos;s a tool to help (shameless plug here).  Take a look at &lt;a href=&quot;http://varscoper.riaforge.org/&quot;&gt;varscoper&lt;/a&gt;.  Hopefully this will become an integral tool in your development process.
				
				</description>
						
				
				<category>varScoper</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Mon, 21 Jul 2008 17:18:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2008/7/21/Thread-safety-and-the-var-scope--live-example</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>New varScoper release candidate</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2008/6/25/new-varscoper-release-candidate</link>
				<description>
				
				A new release candidate is available for my varScoper tool.&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.schierberl.com/varscoper/download.cfm?rc=true&quot;&gt;varscoper_1_30_RC.zip&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Please download and run against your code.  If you find any issues please report them at &lt;a href=&quot;http://varscoper.riaforge.org/index.cfm?event=page.addissue&quot;&gt;RIAForge&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;
Thank you to everyone who provided feedback on 1.21.  At least 16 bugs were identified and are now fixed in the RC.  All reported issues and corner cases have been added to the unit test to ensure that it won&apos;t break the same way in the future.  Additionally, thank you to &lt;a href=&quot;http://patweb99.avatu.com/&quot;&gt;Pat Santora&lt;/a&gt;, who was responsible for a majority of the fixes.
&lt;br&gt;&lt;br&gt;
Finally, based on feedback, I&apos;ve included a cfset statement generator to generate blocks of cfset var statements.  However, I take no responsibility for the consequences of using this generated code.
				
				</description>
						
				
				<category>varScoper</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Wed, 25 Jun 2008 18:12:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2008/6/25/new-varscoper-release-candidate</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>quick varScoper update</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2008/5/22/quick-varScoper-update</link>
				<description>
				
				Version 1.21 of varscoper is now available to &lt;a href=&quot;http://www.schierberl.com/varscoper/download.cfm&quot;&gt; download &lt;/a&gt;.  This is a minor update that fixes some of the CF6, CF7, and *nix issues that were reported when I released 1.20.

Additionally, there was a minor fix to cfscript parsing when using a function inside a struct set. Something similar to this...

&lt;code&gt;
mystruct[someFunction()] = &quot;&quot;;
&lt;/code&gt;
				
				</description>
						
				
				<category>varScoper</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Thu, 22 May 2008 09:37:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2008/5/22/quick-varScoper-update</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>varScoper 1.20 - critical update</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2008/5/20/varScoper-120-released--critical-update</link>
				<description>
				
				Version 1.20 of varscoper is now out on &lt;a href=&quot;http://www.riaforge.com/&quot;&gt;RIAForge&lt;/a&gt;.  It&apos;s also available directly from the &lt;a href=&quot;http://www.schierberl.com/varscoper/download.cfm&quot;&gt;download link&lt;/a&gt;.  
&lt;br&gt;&lt;br&gt;
Many thanks to &lt;a href=&quot;http://patweb99.avatu.com/&quot;&gt;Pat Santora&lt;/a&gt; for this release.  The majority of the content in this release is a direct result of his hard work.

&lt;h3&gt;Updates&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Improvements to cfscript parsing engine&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;RIAForge issues 6,7,8,9,10,11 are fixed&lt;/li&gt;
&lt;li&gt;Improved handling of script comments&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;strong&gt;Ability to exclude files/folders&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;configured through properties.xml&lt;li&gt;Ability to exclude individual files or directories from your search&lt;/ul&gt;
&lt;li&gt;&lt;strong&gt;Integrated Unit Testing&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;testCaseCFC.cfc now includes positive/negative test cases for all reported issues
&lt;li&gt;Currently still reporting 2 known issues that will be addressed in a future release 
&lt;/ul&gt;
&lt;li&gt;&lt;strong&gt;Improvements to parsing engine&lt;/strong&gt;
&lt;ul&gt;&lt;li&gt;Fix for Ray&apos;s cffeed bug (also fixes cfprocparam)
&lt;li&gt;More agressive var scope checking (re-run against all your code, we found 2 new unscoped vars at Planitax)&lt;/ul&gt;

&lt;/ul&gt;
				
				</description>
						
				
				<category>varScoper</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Tue, 20 May 2008 22:17:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2008/5/20/varScoper-120-released--critical-update</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Minor update to varscoper</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2007/12/6/Minor-update-to-varscoper</link>
				<description>
				
				I just released a 1.12 update to my varscoper tool.&amp;nbsp; I&apos;ve added new tags to the parsing engine, added XML output support, and fixed some bugs related to directory parsing in CF6.&amp;nbsp; Thanks to   Kola Oyedegi for help with XML output and Dmitriy Goltseker for fixing directory processing.&amp;nbsp; Thanks to everyone who helped to refine the list of tags that create variables.&amp;nbsp; The additions are below.&amp;nbsp; You can also &lt;a href=&quot;http://www.schierberl.com/varscoper/download.cfm&quot;&gt;download 1.12 here&lt;/a&gt; , or get it via SVN on riaforge.&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;cfhttp:result  &lt;/li&gt;
    &lt;li&gt;cfquery:result&lt;/li&gt;
    &lt;li&gt;  cfimage:name&lt;/li&gt;
    &lt;li&gt;  cfmail:query&lt;/li&gt;
    &lt;li&gt;  cffeed:name&lt;/li&gt;
    &lt;li&gt;  cffeed:query&lt;/li&gt;
    &lt;li&gt;  cfftp:name&lt;/li&gt;
    &lt;li&gt;  cfwddx:output&lt;/li&gt;
    &lt;li&gt;  cfobject:name&lt;/li&gt;
    &lt;li&gt;  cfsearch:name&lt;/li&gt;
    &lt;li&gt;  cfprocresult:name&lt;/li&gt;
    &lt;li&gt;  cfpop:name&lt;/li&gt;
    &lt;li&gt;  cfregistry:name&lt;/li&gt;
    &lt;li&gt;  cfreport:name&lt;/li&gt;
    &lt;li&gt;  cfdbinfo:name&lt;/li&gt;
    &lt;li&gt;  cfdocument:name&lt;/li&gt;
    &lt;li&gt;  cfexecute:variable&lt;/li&gt;
    &lt;li&gt;  cfNtAuthenticate:result&lt;/li&gt;
    &lt;li&gt;  cfcollection:name&lt;/li&gt;
    &lt;li&gt;  cfpdf:name&lt;/li&gt;
    &lt;li&gt;  cfxml:variable&lt;/li&gt;
    &lt;li&gt;  cfzip:name&lt;/li&gt;
    &lt;li&gt;  cfldap:name&lt;/li&gt;
&lt;/ul&gt;
				
				</description>
						
				
				<category>varScoper</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Thu, 06 Dec 2007 12:44:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2007/12/6/Minor-update-to-varscoper</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Can you name all the tags that create variables?</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2007/10/22/Can-you-name-all-the-tags-that-create-variables</link>
				<description>
				
				As part of the development effort on my &lt;a href=&quot;http://www.schierberl.com/varscoper&quot;&gt;var-scoping tool&lt;/a&gt; I have been trying to identify all of the tags that can create variables.&amp;nbsp;&amp;nbsp; I have yet to find a comprehensive listing of tags, so I&apos;m hoping that people can leave comments here to expand the list.&lt;br /&gt;
&lt;br /&gt;
Here&apos;s my partial list to start with (yes I know it&apos;s small), along with the parameter that specifies the variable name.&amp;nbsp; Please comment on my blog and add on any that I&apos;ve missed.&lt;br /&gt;
&lt;br /&gt;
cfloop:index&lt;br /&gt;
cfloop:item&lt;br /&gt;
cfquery:name&lt;br /&gt;
cfinvoke:returnvariable&lt;br /&gt;
cfdirectory:name&lt;br /&gt;
cffile:variable&lt;br /&gt;
cfparam:name&lt;br /&gt;
cfsavecontent:variable&lt;br /&gt;
cfform:name&lt;br /&gt;
cfstoredproc:name&lt;br /&gt;
cfprocparam:variable&lt;br /&gt;
				
				</description>
						
				
				<category>varScoper</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Mon, 22 Oct 2007 16:44:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2007/10/22/Can-you-name-all-the-tags-that-create-variables</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>varScoper 1.1 - now with cfscript parsing</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2007/10/7/varScoper-11--now-with-cfscript-parsing</link>
				<description>
				
				That&apos;s right, my varScoper tool now supports cfml written within cfscript blocks.&amp;nbsp; Please note that this is still somewhat experimental, but seems to handle quite a few scenarios.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.schierberl.com/varscoper/download.cfm&quot;&gt;Click here to download the 1.1 code.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.schierberl.com/varscoper&quot;&gt;Here&apos;s a link to the project page.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Many thanks to &lt;a href=&quot;http://zacster.blogspot.com/&quot;&gt;Zac Spitzer&lt;/a&gt; who is responsible for writing the code to identify var statements within cfscript.&amp;nbsp; He completed the cfscript var statement support as a response to &lt;a href=&quot;http://www.nodans.com/index.cfm/2007/9/27/Is-your-code-Thread-Safe-How-do-you-know&quot;&gt;this post&lt;/a&gt;.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
After looking at Zac&apos;s code, I decided to take it to the next level and complete the code required to identify variables created within cfscript blocks.&lt;br /&gt;
&lt;br /&gt;
The code will even ignore variables created within comments, but unfortunately does not include the ability to identify the line number of the variable (which it does within tags).&amp;nbsp; You can still jump directly to the method, but you&apos;re on your own to find the variable.&lt;br /&gt;
&lt;br /&gt;
You can even identify variables created within for loops and if/else blocks.&amp;nbsp; Here&apos;s an example...  &lt;br /&gt;
&lt;code&gt;
for(correctLoop=1;correctLoop LTE 10; correctLoop=correctLoop+1) correctSimpleVar = correctLoop;&lt;/code&gt;  &lt;br /&gt;
In this example correctLoop, and correctSimpleVar will both be identified with the tool.&lt;br /&gt;
&lt;br /&gt;
For those of you who aren&apos;t aware of varscoper, it is a code analyzer that will look for variables without a var statement that exist within a cffunction.&amp;nbsp; I released the tool last July and cfscript support has been the #1 request.&lt;br /&gt;
&lt;br /&gt;
Additionally, I am now hosting the project at RIAforge at &lt;a href=&quot;http://varscoper.riaforge.org/&quot;&gt;http://varscoper.riaforge.org/&lt;/a&gt;, you can look there for SVN access.&lt;br /&gt;
&lt;br /&gt;
Please take a minute to test out the code and please let me know ASAP if you can find any cases that the cfscript code doesn&apos;t cover.
				
				</description>
						
				
				<category>varScoper</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Sun, 07 Oct 2007 19:43:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2007/10/7/varScoper-11--now-with-cfscript-parsing</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Sessions DO NOT expire on browser close</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2007/10/1/Sessions-DO-NOT-expire-on-browser-close</link>
				<description>
				
				I have interviewed quite a few people lately for a few positions at my company.&amp;nbsp;&amp;nbsp; An interesting thing that I have noticed is that the majority of people I interview seem to think that session variables ALWAYS expire on browser close.&amp;nbsp; However in a default CF install, session variables will persist even after a browser is closed and re-opened.&amp;nbsp; This could mean that your users continue to be &amp;quot;logged in&amp;quot; to your application even after they close their browser.&lt;br /&gt;
&lt;br /&gt;
The default behavior of a ColdFusion installation does not use per-session cookies in a browser, it uses persistent cookies instead.&amp;nbsp; The difference being that per-session cookies are stored in client memory and are destroyed on browser close where persistent cookies are stored on disk and are available after a browser has been closed an opened.&lt;br /&gt;
&lt;br /&gt;
There are reasons to use both per-session cookies as well as persistent cookies, but you should be aware of the difference.&amp;nbsp; In a secure application, users generally expect that their session will end on browser close so you should be careful to enforce this behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;How do I change this???&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;There are a few ways to accomplish per-session cookie management in your application.&amp;nbsp; One approach is to enable &amp;quot;&lt;strong&gt;Use J2EE session variables&amp;quot;&lt;/strong&gt; in ColdFusion administrator, but you can also accomplish this in code.&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_17915&amp;amp;sliceId=1&quot;&gt; Take a look at this knowledgebase article for an extended explanation.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
				
				</description>
						
				
				<category>coldfusion</category>				
				
				<pubDate>Mon, 01 Oct 2007 23:06:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2007/10/1/Sessions-DO-NOT-expire-on-browser-close</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Hiring Engineers in the Bay Area</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2007/8/29/Hiring-Engineers-in-the-Bay-Area</link>
				<description>
				
				I have an immediate need for Senior ColdFusion developers in Emeryville, CA.&amp;nbsp; I&apos;m looking to fill 3 full time positions and 5 contract positions.&amp;nbsp; Applicants should have a minimum of 3-5 years of development experience with CF, strong understanding of CFCs and Object Oriented concepts, and preferably experience on at least one large project with mach-ii or model-glue.&lt;br /&gt;
&lt;br /&gt;
All positions will need to report on site at our offices in Emeryville.&amp;nbsp; The name of the company is &lt;a href=&quot;http://www.planitax.com&quot;&gt;Planitax&lt;/a&gt; , and we have a hosted software solution targeted to tax departments in Fortune 1000 corporations.&amp;nbsp; We have a robust client base (intel, at&amp;amp;t, sun for example) and we are growing rapidly.&amp;nbsp; The application is very mature and it would&amp;nbsp; be a great opportunity to work with  some top notch developers, and explore advanced concepts.&amp;nbsp; Pay is extremely competitive, and we have a great work environment.&lt;br /&gt;
&lt;br /&gt;
Please contact our human resources department at &lt;a href=&quot;mailto:mike.schierberl@planitax.com?subject=Senior%20Developer%20at%20Planitax%20From%20Blog%20Posting&quot;&gt;human.resources@planitax.com&lt;/a&gt; if you are interested in applying.&amp;nbsp; Please NO recruiters.
				
				</description>
						
				
				<category>other</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Wed, 29 Aug 2007 11:21:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2007/8/29/Hiring-Engineers-in-the-Bay-Area</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Memory Leaks: Part III - sessions and cfcs</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2006/10/25/memoryLeaks_session</link>
				<description>
				
				&amp;nbsp;&amp;nbsp;&amp;nbsp; In part III of my memory leak posts, I will attempt to show an example of how variable references can increase within in the heap on every request. If you would like to know more about the tools I used to identify the problem, or would like to follow along with the example you should take a look at my previous posts, &lt;br /&gt;
&lt;a href=&quot;../../../index.cfm/2006/10/12/ColdFusion_memoryLeak_profiler&quot;&gt;&amp;quot;ColdFusion Memory Leaks: Part I - profiler introduction&amp;quot;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.schierberl.com/cfblog/index.cfm/2006/10/16/memoryLeak_variablesScope&quot;&gt;&amp;quot;ColdFusion Memory Leaks: Part II - variables scope&amp;quot;&lt;/a&gt;&lt;br /&gt;
&lt;font color=&quot;#ff0000&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Note:&amp;nbsp; The example that I will demonstrate is 90% complete.&amp;nbsp; It is similar to the behavior that I experienced in my application, but not as severe.&amp;nbsp; This only works in specific circumstances, where my problem appeared 100% of the time.&amp;nbsp; Unfortunately, this is the closest I could come without including hundreds of thousands of lines of code.&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
For this example, we will expand the case that I demonstrated in the variables scope example.&amp;nbsp; We will use the same test.cfc as the previous example.&lt;br /&gt;
&lt;code&gt;&lt;!--- file: test.cfc ---&gt;
&lt;cfcomponent name=&quot;test&quot;&gt;   
   &lt;cffunction name=&quot;init&quot;&gt;
      &lt;cfreturn this &gt;
   &lt;/cffunction&gt;
   
   &lt;cffunction name=&quot;doSomething&quot;&gt;
      &lt;cfset var idx = &quot;&quot; /&gt;
      &lt;cfset var arrayToReturn = arrayNew(1) /&gt;
      &lt;cfloop from=&quot;1&quot; to=&quot;100&quot; index=&quot;idx&quot;&gt;
         &lt;cfset arrayAppend(arrayToReturn,createObject(&quot;component&quot;,&quot;test&quot;).init()) /&gt;
      &lt;/cfloop&gt;
      &lt;cfreturn arrayToReturn &gt;
   &lt;/cffunction&gt;
&lt;/cfcomponent&gt;&lt;/code&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Next we will need to expand the cfm page, we&apos;ll make the following modifications.&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;add session timeout of 10 seconds (to see results quickly)&lt;/li&gt;
    &lt;li&gt;only load test.cfc into application on the first request&lt;/li&gt;
    &lt;li&gt;create an array on the session&lt;/li&gt;
    &lt;li&gt;create a new instance of test.cfc locally, and append it to the array on the session&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;code&gt;&lt;!--- file: test.cfm ---&gt;
&lt;cfapplication name=&quot;memoryTest&quot; sessionmanagement=&quot;true&quot; sessiontimeout=&quot;#createTimeSpan(0,0,0,10)#&quot; &gt;

&lt;!--- create an instance of test.cfc in application, adding reset to the URL, will cleanup all references ---&gt;
&lt;cfif not structKeyExists(application,&quot;test&quot;) OR isDefined(&quot;URL.reset&quot;)&gt; 
	&lt;cfset application.test = createObject(&quot;component&quot;,&quot;test&quot;).init() /&gt;
	&lt;cflocation url=&quot;#cgi.SCRIPT_NAME#&quot; addtoken=&quot;false&quot;&gt;
&lt;/cfif&gt;

&lt;cfset foo = application.test.doSomething() /&gt;

&lt;cfif not structKeyExists(session,&quot;sessionArray&quot;)&gt;
	&lt;cfset session.sessionArray = arrayNew(1)&gt;
	creating a new session&lt;br /&gt;
&lt;/cfif&gt;

&lt;cfset objectToPutInSession = createObject(&quot;component&quot;,&quot;test&quot;) &gt;

&lt;cfset arrayAppend(session.sessionArray,objectToPutInSession)&gt;

completed request - session size = &lt;cfoutput&gt;#arrayLen(session.sessionArray)#&lt;/cfoutput&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;cfoutput&gt;&lt;a href=&quot;#cgi.SCRIPT_NAME#?reset=true&quot;&gt;reset application.test (this clears all memory references)&lt;/a&gt;&lt;/cfoutput&gt; &lt;/code&gt;  What should we expect in this example? (feel free to correct me if you think this should be different)&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;1 instance of test.cfc should be loaded into application&lt;/li&gt;
    &lt;li&gt;foo exists in variables scope and creates a reference to an array of 100 instances of test.cfc (this is the example from Part II and should be destroyed at the end of the request)&lt;/li&gt;
    &lt;li&gt;an instance of test.cfc will be added to the session on every request. (5 request in a session = 5 test.cfc)&lt;/li&gt;
    &lt;li&gt;when the session expires, the array should be cleaned from the heap.&lt;/li&gt;
&lt;/ul&gt;
Now for a flash movie that will show the results of what actually happens (my apologies if this is rushed, there&apos;s quite a bit going on in a short timeframe)&lt;br /&gt;
&lt;div class=&quot;flash600obj&quot;&gt;  

&lt;mikeFlashObjectobject classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0&quot; id=&quot;FLVPlayer&quot; height=&quot;312&quot; width=&quot;600&quot;&gt;    
&lt;param name=&quot;movie&quot; value=&quot;/cfblog/FLVPlayer_Progressive.swf&quot;&gt;    
&lt;param name=&quot;salign&quot; value=&quot;lt&quot;&gt;    
&lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;    
&lt;param name=&quot;scale&quot; value=&quot;noscale&quot;&gt;    
&lt;param name=&quot;FlashVars&quot; value=&quot;&amp;amp;MM_ComponentVersion=1&amp;amp;skinName=/cfblog/Clear_Skin_2&amp;amp;streamName=/cfblog/memLeakSession&amp;amp;autoPlay=false&amp;amp;autoRewind=false&quot;&gt;    &lt;mikeFlashObjectembed src=&quot;/cfblog/FLVPlayer_Progressive.swf&quot; flashvars=&quot;&amp;amp;MM_ComponentVersion=1&amp;amp;skinName=/cfblog/Clear_Skin_2&amp;amp;streamName=/cfblog/memLeakSession&amp;amp;autoPlay=false&amp;amp;autoRewind=false&quot; quality=&quot;high&quot; scale=&quot;noscale&quot; name=&quot;FLVPlayer&quot; salign=&quot;LT&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; height=&quot;312&quot; width=&quot;600&quot;&gt;  &lt;/mikeFlashObjectobject&gt;  &lt;/div&gt;

&lt;br /&gt;
What happened??(also, how you can follow along if you execute the example)&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;On the first request, test.cfc is loaded into the application at the same time a new session is created&lt;/li&gt;
    &lt;li&gt;Every request loads an extra 100 references to test.cfc (which should only exist in variables scope)&lt;/li&gt;
    &lt;li&gt;The session that loads the cfc into application scope (and only this session) will persist all the references for the life of the application&lt;/li&gt;
    &lt;li&gt;All additional sessions will hold their references for the life of the session&lt;/li&gt;
    &lt;li&gt;Adding a structure to session instead of a cfc will create the proper behavior&lt;/li&gt;
&lt;/ul&gt;
&lt;font size=&quot;4&quot;&gt;Summary&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Why does this happen?&amp;nbsp; I can&apos;t tell you, I&apos;m hoping the community, or adobe will be able to figure that out.&amp;nbsp; Some other notes that I would like to add.... The behavior occurs if it is a struct OR an array on the session.&amp;nbsp; The behavior also occurs if all the cfcs are different (I used test.cfc for all references to keep the example simple).&amp;nbsp; If you reload application.test, the references will be cleaned up, but the behavior will occur for the session associated with the request that created application.test.&lt;br /&gt;
&lt;br /&gt;
&lt;font size=&quot;4&quot;&gt;How do I fix this in my application???&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; I am not going to recommend a solution for this because I haven&apos;t found a &amp;quot;magic bullet&amp;quot; yet.&amp;nbsp; I am also not going to recommend a solution because every application is unique, and every memory leak is different.&amp;nbsp; I will however tell you that my problem was very similar to this.&amp;nbsp; We were keeping a history stack on the session that consisted of an array of simple beans.&amp;nbsp; Converting the beans to structures, solved a large part of the problem.&amp;nbsp; This isn&apos;t always an option if you are storing complex objects on the session.&amp;nbsp; I&apos;m very interested to see if anyone else having a similar problem is storing cfcs on a session, as the root cause seems to be a wacky combination of instantiating cfcs on multiple scopes within a request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
				
				</description>
						
				
				<category>memory</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Wed, 25 Oct 2006 16:15:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2006/10/25/memoryLeaks_session</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Memory Leaks: Part II - variables scope leak</title>
				<link>http://www.schierberl.com/cfblog/index.cfm/2006/10/16/memoryLeak_variablesScope</link>
				<description>
				
				&amp;nbsp;&amp;nbsp;&amp;nbsp; In part II of my memory leak posts, I will attempt to demonstrate a simple example of how the CFML runtime engine can cause memory leaks.&amp;nbsp; If you would like to know more about the tools I used to identify the problem, or would like to follow along with the example you should take a look at my previous post,&amp;nbsp; &lt;a href=&quot;http://www.schierberl.com/cfblog/index.cfm/2006/10/12/ColdFusion_memoryLeak_profiler&quot;&gt;&amp;quot;ColdFusion Memory Leaks: Part I - profiler introduction&amp;quot;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; For those of you that have ever experienced memory leaks, have there been cases where you have been convinced that the problem is not your code?&amp;nbsp; Well, you may actually be right.&amp;nbsp; This example will show a very simple case, then I will try to build on this to show a more problematic example in my next post.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The first part of the example is to create a simple .cfc.&amp;nbsp; This cfc will have 2 methods: init() which returns itself, and doSomething()&amp;nbsp; which will return an array of 100 instances of itself.&lt;br /&gt;
&lt;code&gt;&lt;!--- file: test.cfc ---&gt;
&lt;cfcomponent name=&quot;test&quot;&gt;	
	&lt;cffunction name=&quot;init&quot;&gt;
		&lt;cfreturn this &gt;
	&lt;/cffunction&gt;
	
	&lt;cffunction name=&quot;doSomething&quot;&gt;
		&lt;cfset var idx = &quot;&quot; /&gt;
		&lt;cfset var arrayToReturn = arrayNew(1) /&gt;
		&lt;cfloop from=&quot;1&quot; to=&quot;100&quot; index=&quot;idx&quot;&gt;
			&lt;cfset arrayAppend(arrayToReturn,createObject(&quot;component&quot;,&quot;test&quot;).init()) /&gt;
		&lt;/cfloop&gt;
		&lt;cfreturn arrayToReturn &gt;
	&lt;/cffunction&gt;
&lt;/cfcomponent&gt;&lt;/code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;  The next part of the example will be a simple cfm file.&amp;nbsp; This file will create 1 instance of the test.cfc and load it into application scope, then it will call the doSomething() function and set the result to a local variable that resides in variables scope. &lt;br /&gt;
&lt;code&gt;&lt;!--- file: test.cfm ---&gt;
&lt;cfapplication name=&quot;memoryTest&quot;&gt;

&lt;cfset application.test = createObject(&quot;component&quot;,&quot;test&quot;).init() /&gt;

&lt;cfset foo = application.test.doSomething() /&gt;

&lt;cfoutput&gt;foo is an array of #arrayLen(foo)# elements&lt;/cfoutput&gt;&lt;/code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; What should we expect from this example?&amp;nbsp; Well, we should have 1 instance of test.cfc persisted in the heap.&amp;nbsp; We will create 100 references to test.cfc, but those should only exist in the heap until the end of the request.&amp;nbsp; The garbage collector should pick them up immediately, as all references should only exist for the request.&lt;br /&gt;
&lt;br /&gt;
Now, to show the results of the test, I created a flash movie that will show the behavior,&amp;nbsp; watch it to see what actually happens.&lt;br /&gt;
&lt;div class=&quot;flash600obj&quot;&gt;
&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0&quot; width=&quot;600&quot; height=&quot;306&quot; id=&quot;FLVPlayer&quot;&gt;
  &lt;param name=&quot;movie&quot; value=&quot;/cfblog/FLVPlayer_Progressive.swf&quot; /&gt;
  &lt;param name=&quot;salign&quot; value=&quot;lt&quot; /&gt;
  &lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;
  &lt;param name=&quot;scale&quot; value=&quot;noscale&quot; /&gt;
  &lt;param name=&quot;FlashVars&quot; value=&quot;&amp;MM_ComponentVersion=1&amp;skinName=/cfblog/Clear_Skin_2&amp;streamName=/cfblog/simple_Leak&amp;autoPlay=false&amp;autoRewind=false&quot; /&gt;
  &lt;embed src=&quot;/cfblog/FLVPlayer_Progressive.swf&quot; flashvars=&quot;&amp;MM_ComponentVersion=1&amp;skinName=/cfblog/Clear_Skin_2&amp;streamName=/cfblog/simple_Leak&amp;autoPlay=false&amp;autoRewind=false&quot; quality=&quot;high&quot; scale=&quot;noscale&quot; width=&quot;600&quot; height=&quot;306&quot; name=&quot;FLVPlayer&quot; salign=&quot;LT&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; /&gt;
&lt;/object&gt;
&lt;/div&gt;


  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;font size=&quot;4&quot; color=&quot;#ff0000&quot;&gt; Results:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;What happened?&amp;nbsp; As you can see, 101 instances were persisted in the heap, and not released.&amp;nbsp; These instances will live for the life of the application and NOT for the life of the request as intended.&amp;nbsp; In this case we should only see 1 instance of the cfc in the heap. Here are some of the behaviors I observed. &lt;br / &gt; &lt;br / &gt; &lt;ol &gt; &lt;li &gt; references to objects created in application scope will be kept alive if they are
set to a reference in the variables scope. &lt;/li &gt; &lt;li &gt; Setting the variable in variables scope to empty string &amp;quot; &amp;quot; 
                      will destroy the reference. &lt;/li &gt; &lt;li &gt; Setting the reference in request scope will clean up the reference correctly. &lt;/li &gt; &lt;li &gt; Calling structClear(variables)
                       in onRequestEnd.cfm will destroy unwanted references tied to variables scope &lt;/li &gt; &lt;li &gt; The reference retained in the variables scope only seems
                       to apply to the last request to the.cfm file (will not grow) &lt;/li &gt; &lt;/ol &gt; &lt;font size = [4] color = [#ff0000] &gt; Summary : &lt;/font &gt; &lt;br / &gt; &amp;nbsp; 
                      &amp;nbsp;&amp;nbsp; As you can see, this isn &apos;t a horrible memory leak because it won&apos;t grow continually, 
                      but it could cause unwanted objects to be persisted in memory. &amp;nbsp; This IS a simple example, and 
                      I&apos;m working to create a similar, but more complex example to build on this that will show that cfc references can grow in memory on every request.&amp;nbsp; Stay Tuned.


				
				</description>
						
				
				<category>memory</category>				
				
				<category>coldfusion</category>				
				
				<pubDate>Mon, 16 Oct 2006 11:50:00 -0700</pubDate>
				<guid>http://www.schierberl.com/cfblog/index.cfm/2006/10/16/memoryLeak_variablesScope</guid>
				
			</item>
			
		 	
			</channel></rss>