ColdFusion Memory Leak, you think?

February 29, 2008 at 5:56 am Leave a comment


Got lots of memory consumption and have no idea where it’s going? Thinking it might be a memory leak in ColdFusion MX?

One of the first things you should look at is the amount of session variables you set. If you have the session timeout set high and/or you create some large objects in the session scope, you_have_to_remember that these session variables are created for EACH request when a client does NOT accept cookies.

Why? Because upon each request ColdFusion thinks that it is a new client, it doesn’t see a cookie so it must be a new client.

Ways to overcome this are:

         setting URL tokens; not recommended.

         Store the IP in the application scope (you can create a hash of IP and USER AGENT as well) and keep track of the clients you cannot set a cookie for. Based upon this information you can decide whether to set the session variables again in following requests.

Situations where this will most likely occur are when bots or email harvesters spider the site without accepting cookies.

 You can put some of the logic in onSessionStart, this method is called each time a new session is created. If a client does not accept cookies, a new session will be created for each request.

Advertisements

Entry filed under: ColdFusion. Tags: , .

Australian Business Directory Review Alexa ranking up again

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 19 other followers

Archives

Top Rated

Blog Stats

  • 167,630 hits

%d bloggers like this: