pf » ColdFusion Garbage
ColdFusion Garbage
Now that you have had a chance to read my outline of garbage collection tuning in java. You should be asking yourself how does this relate to my ColdFusion server. Or maybe you just wondered what Garbage Collection has to do with ColdFusion Servers.
So I'll start with a really quick overview of what garbage collection (GC) is. In Java your variables are represented as objects on the heap (the heap is the chunk of memory you allocate to the JVM), the objects are considered to be either alive (in use) or dead (out of scope, no references point to it). For instance when you have a request variable, it is out of scope at the end of your http request (there is no way to access that variable again). So the Java Virtual Machine (the JVM) needs some way of freeing the memory that dead objects are taking up, this process is called garbage collection.
The first thing you might notice after reading the garbage collection outline is that ColdFusion MX 6.1 is using the throughput collector, or the parallel young generation collector (-XX:+UseParallelGC) by default. If your ColdFusion server only has one CPU you may get better performance by using the default collector. If you have hyperthreading enabled CPU's you may be ok. If your server has multiple CPU's you may try tuning the number of threads that the parallel collector is using with -XX:ParallelGCThreads=n.
If you have 4 CPU's with lots of RAM you might want to try adding -XX:+AggressiveHeap to your JVM startup options. You might also want to try this if you have 2 CPU's with hyperthreading enabled.
It may be a good idea to increase your -XX:MaxPermSize=n if you have a lot of CFM files. Since each file is a class, you are adding a lot of class and method info to the perm generation.
Another thing you can try tuning is the sizes of the young and tenured generations. You can do this with the -XX:NewRatio option. If you have a lot of cached, or persistent variables you will want to have a bigger tenured generation. But if your doing a lot of dynamic execution then you may be better off increasing your young generation.
Tuning is always about tradeoffs, and the specifics of your application, and your hardware.
Related Entries
- Robi Sen on Hung Servers, java.lang.OutOfMemory errors and Tuning CF JVM - November 19, 2004
- Tuning Garbage Collection - June 3, 2004
- Visualize Garbage Collection - June 8, 2004
- ColdFusion Memory Usage Stats - March 15, 2004
- Have you tuned your JVM on ColdFusion MX yet? - September 25, 2002
- CFSCRIPT Cheatsheet
- 3 New Image Effects for ColdFusion 8
- Googlebot to Submit Web Forms
- ColdFusion 8 Update 1 Fixes some Image Processing Quirks
- 10 Most Useful Image Functions in ColdFusion 8
- Speaking at NYC CFUG This Week
- Adobe AIR Tutorial for HTML / JavaScript Developers
- INFORMATION_SCHEMA Support in MySQL, PostgreSQL
RSS
add to del.icio.us
Pete Freitag is a software engineer, and web developer located in










