Memory Leak / Out of Memory Errors
criticalSymptoms
- java.lang.OutOfMemoryError: Java heap space
- Application becomes unresponsive over time
- Memory usage continuously increases
- Frequent garbage collection
Diagnosis Steps
- Enable GC logging: -Xlog:gc*:file=gc.log
- Monitor heap usage in PMT or FusionReactor
- Check for session variable accumulation
- Review query caching configuration
- Analyze heap dumps with Eclipse MAT
Solutions
-Xms8g -Xmx8g (example for 8GB heap)// Clear large session variables
<cfset structDelete(session, "largeData")>
// Limit query caching
<cfquery name="q" cachedWithin="#createTimeSpan(0,0,5,0)#">-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:G1HeapRegionSize=16m<cfapplication
name="myApp"
sessionmanagement="yes"
sessiontimeout="#createTimeSpan(0,0,30,0)#"
setclientcookies="yes">Prevention
Monitor heap usage proactively, implement session size limits, use query caching judiciously, regular heap dump analysis
Slow Page Load Times / High Response Times
highSymptoms
- Pages taking >3 seconds to load
- High P95/P99 response times
- User complaints about slowness
- Timeouts during peak load
Diagnosis Steps
- Enable PMT request tracking
- Profile slow templates with FusionReactor
- Check database query execution times
- Review web server connector settings
- Analyze thread dump for bottlenecks
Solutions
// Add indexes to frequently queried columns
CREATE INDEX idx_userid ON users(userid);
// Use cfqueryparam for all variables
<cfquery name="getUser">
SELECT * FROM users
WHERE userid = <cfqueryparam value="#userid#" cfsqltype="cf_sql_integer">
</cfquery>// Template caching
<cfcache action="cache" timespan="#createTimeSpan(0,1,0,0)#">
// Query caching
<cfquery name="getData" cachedWithin="#createTimeSpan(0,0,10,0)#">
SELECT * FROM products WHERE active = 1
</cfquery>
// Object caching with Redis
<cfset cachePut("userdata_#userid#", userData, createTimeSpan(0,0,30,0))>// In server.xml
<Connector port="8500"
maxThreads="200"
minSpareThreads="25"
connectionTimeout="20000"
acceptCount="100"
enableLookups="false"
compression="on"
compressionMinSize="2048"/>// Defer non-critical operations
<cfif structKeyExists(url, "loadExtras")>
<cfset heavyData = getExpensiveData()>
</cfif>Prevention
Regular performance testing, query optimization reviews, caching strategy, CDN for static assets
SQL Injection Vulnerabilities
criticalSymptoms
- Security scan findings
- Unexpected SQL errors in logs
- Unauthorized data access
- Database anomalies
Diagnosis Steps
- Run security scanner (OWASP ZAP, Burp Suite)
- Code review for dynamic SQL
- Check query logs for suspicious patterns
- Review all user input handling
Solutions
// VULNERABLE CODE - DO NOT USE
<cfquery name="badQuery">
SELECT * FROM users WHERE username = '#form.username#'
</cfquery>
// SECURE CODE - ALWAYS USE
<cfquery name="secureQuery">
SELECT * FROM users
WHERE username = <cfqueryparam value="#form.username#" cfsqltype="cf_sql_varchar" maxlength="50">
</cfquery>// Input validation
<cfif NOT reFindNoCase("^[a-zA-Z0-9_]{3,20}$", form.username)>
<cfthrow message="Invalid username format">
</cfif>
// Whitelist approach
<cfset validSortColumns = ["name", "date", "id"]>
<cfif NOT arrayContains(validSortColumns, url.sortBy)>
<cfset url.sortBy = "name">
</cfif>// Use ORM instead of dynamic queries
entityLoad("User", {username: form.username}, true)// Use queryExecute with params
queryExecute(
"SELECT * FROM users WHERE username = :username",
{username: {value: form.username, cfsqltype: "varchar"}}
)Prevention
Code review checklist, automated security scanning, developer training, never trust user input
Cross-Site Scripting (XSS) Vulnerabilities
highSymptoms
- Security scan XSS findings
- Unexpected JavaScript execution
- Session hijacking attempts
- Malicious user-generated content
Diagnosis Steps
- Test with XSS payloads in all inputs
- Review output encoding practices
- Check Content Security Policy headers
- Scan with automated tools
Solutions
// HTML context encoding
<p>#encodeForHTML(userInput)#</p>
// JavaScript context encoding
<script>
var userName = "#encodeForJavaScript(userInput)#";
</script>
// URL context encoding
<a href="profile.cfm?user=#encodeForURL(userInput)#">Profile</a>
// CSS context encoding
<div style="color: #encodeForCSS(userColor)#">// In Application.cfc
function onRequestStart(targetPage) {
cfheader(name="Content-Security-Policy",
value="default-src 'self'; script-src 'self' 'unsafe-inline' https://trusted-cdn.com; style-src 'self' 'unsafe-inline'");
cfheader(name="X-Content-Type-Options", value="nosniff");
cfheader(name="X-Frame-Options", value="SAMEORIGIN");
// Omit X-XSS-Protection (deprecated); rely on CSP instead
}// Built-in AntiSamy-based sanitizer (CF 11+)
<cfset cleanHTML = getSafeHTML(userHTML)>
// Optional: pass your own AntiSamy policy file
<cfset cleanHTML = getSafeHTML(userHTML, expandPath("./antisamy-policy.xml"))>
// Check without modifying
<cfif NOT isSafeHTML(userHTML)>
<!--- Reject or log the input --->
</cfif>Prevention
Output encoding by default, CSP headers, input validation, regular security testing
Connection Pool Exhausted
highSymptoms
- Error: "Unable to get connection from pool"
- Timeouts waiting for database connection
- Application hangs during database operations
- Growing connection count
Diagnosis Steps
- Check current pool usage in CF Admin
- Review connection timeout settings
- Look for unclosed queries/connections
- Monitor database connection count
- Check for long-running queries
Solutions
// CF Admin: Data & Services > Data Sources > [datasource]
// > Advanced Settings: raise the connection limit for the pool
// Application-specific datasources can also be defined in
// Application.cfc with this.datasources (a struct of structs).
// These do not register or update the datasource in CF Admin.// Always close connections in finally block
<cftry>
<cfquery name="getData" datasource="myDB">
SELECT * FROM products
</cfquery>
<cfcatch>
<cflog file="errors" text="#cfcatch.message#">
</cfcatch>
<cffinally>
<!--- Connection auto-closed with cfquery --->
</cffinally>
</cftry>
// Close stored proc connections
<cfstoredproc procedure="myProc" datasource="myDB">
<cfprocresult name="result">
</cfstoredproc>// Set reasonable timeouts
<cfquery name="getData"
datasource="myDB"
timeout="30"
maxrows="1000">
SELECT * FROM large_table
WHERE date > <cfqueryparam value="#dateAdd('d', -7, now())#" cfsqltype="cf_sql_timestamp">
</cfquery>// CFML has no built-in function for pool statistics.
// Watch datasource metrics in the Performance Monitoring Toolset (PMT)
// or FusionReactor JDBC metrics, and set alerts there
// (e.g. active connections above 80% of the connection limit).Prevention
Right-size connection pools, query timeouts, connection monitoring, regular pool stats review
High Garbage Collection Pause Times
mediumSymptoms
- Application pauses/freezes
- GC logs show pause >500ms
- User reports intermittent slowness
- Request timeouts during GC
Diagnosis Steps
- Enable GC logging: -Xlog:gc*:file=gc.log
- Analyze GC logs with GCViewer or GCEasy
- Check heap usage patterns
- Review GC algorithm configuration
- Monitor with PMT or FusionReactor
Solutions
// In jvm.config
-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
-XX:G1HeapRegionSize=16m
-XX:InitiatingHeapOccupancyPercent=45
-XX:G1ReservePercent=10// Set min = max for consistent performance
-Xms8g -Xmx8g
// Heap should be 50-70% of total RAM
// 16GB server → 8-10GB heap// Parallel GC threads (default: CPU cores)
-XX:ParallelGCThreads=8
// Concurrent GC threads (1/4 of parallel)
-XX:ConcGCThreads=2// Reuse objects instead of creating new
<cfset stringBuilder = createObject("java", "java.lang.StringBuilder").init()>
<cfloop array="#items#" index="item">
<cfset stringBuilder.append(item)>
</cfloop>
<cfset result = stringBuilder.toString()>
// Avoid in-loop object creation
<cfset pattern = createObject("java", "java.util.regex.Pattern").compile("regex")>
<cfloop array="#data#" index="item">
<cfset matcher = pattern.matcher(item)>
</cfloop>Prevention
Proper heap sizing from start, G1GC for heaps >4GB, object allocation review, regular GC monitoring
ColdFusion Administrator Locked Out
highSymptoms
- Cannot access CF Admin
- Forgot admin password
- Admin IP restriction blocking access
Diagnosis Steps
- Check Security > Allowed IP Addresses from a host that is still allowed
- Reset the password with the passwordreset script in cfusion/bin
- Review web server access logs
Solutions
// Run the password reset script in cfusion/bin
// Windows: cfusion\bin\passwordreset.bat
// Linux: cfusion/bin/passwordreset.sh
// Follow the prompts to set a new password, then restart ColdFusion
// Adobe recommends restricting access to passwordreset.bat,
// cf-passwordreset.jar and lib/password.properties// From a host that is already allowed (for example the server itself),
// open CF Admin > Security > Allowed IP Addresses
// and add the IP address you need.
// Regular expressions are supported (for example 10.*.*.*).// The list is stored in cfusion/lib/neo-security.xml under the
// allowedAdminIPList key (an empty string as shipped in the
// ColdFusion 2025 Update 14 Docker image).
// Back up the file, empty that value, then restart ColdFusion.
// Re-add your allowed addresses in the Administrator afterwards.Prevention
Document admin passwords securely, maintain the allowed IP list, back up ColdFusion configuration files
Web Server Connector Not Working
criticalSymptoms
- 404 errors for .cfm files
- Web server serves CFM as text
- CFIDE/administrator not accessible via connector
- Connection refused errors
Diagnosis Steps
- Check connector configuration in web server
- Verify the AJP/1.3 connector port in cfusion/runtime/conf/server.xml matches the connector configuration
- Review web server error logs
- Test direct access to ColdFusion (port 8500)
- Check connector secret key match
Solutions
// Linux/Mac
cd /opt/coldfusion2025/cfusion/runtime/bin
./wsconfig -ws Apache -dir /etc/apache2 -l
// Windows
cd C:\ColdFusion2025\cfusion\runtime\bin
wsconfig.exe -ws IIS -site "Default Web Site" -l
// -l enables verbose connector logging
// Restart web server
sudo systemctl restart apache2// Find the AJP port (Adobe examples use 8012; confirm yours)
grep -i "AJP/1.3" /opt/coldfusion2025/cfusion/runtime/conf/server.xml
// Check that port is listening (replace AJP_PORT)
netstat -an | grep AJP_PORT
// Example server.xml entry
<Connector port="AJP_PORT"
protocol="AJP/1.3"
redirectPort="8445"
secretRequired="true"
secret="your-secret-key"
address="127.0.0.1"/>// Apache and IIS: in the connector workers.properties
worker.cfusion.secret=your-secret-key
// Use the secret value from the AJP connector line
// in cfusion/runtime/conf/server.xml// Linux - Apache needs read access
sudo chmod 644 /etc/apache2/mod_jk.conf
sudo chmod 644 /etc/apache2/workers.properties
sudo systemctl restart apache2Prevention
Document connector setup, backup connector configs, test after CF updates, monitor connector logs
Session Replication Issues in Cluster
mediumSymptoms
- Users logged out randomly
- Session data lost on failover
- Inconsistent session behavior
- Cluster node sync errors
Diagnosis Steps
- Check cluster member status in CF Admin
- Review session replication logs
- Verify multicast/network connectivity
- Check session storage configuration
- Monitor session size
Solutions
// CF Admin > Server Settings > Memory Variables
// Session Storage: Redis
// Enter the Redis server details and port
// Notes from Adobe:
// - Not available when "Use J2EE session variables" is enabled
// - Disable sticky sessions at the load balancer and clear
// Sticky Sessions / Session Replication in Cluster Manager
// Application.cfc still enables sessions as usual
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0, 0, 30, 0);// Store only essential data in session
<cfset session.userId = userQuery.id> // ID only
<cfset session.userName = userQuery.name>
// Load full user object on demand
<cffunction name="getCurrentUser">
<cfif NOT structKeyExists(request, "currentUser")>
<cfset request.currentUser = userService.getById(session.userId)>
</cfif>
<cfreturn request.currentUser>
</cffunction>// NGINX example
upstream coldfusion {
ip_hash; // Sticky sessions by client IP
server cf1.example.com:8500;
server cf2.example.com:8500;
}
// Or use cookie-based
sticky cookie srv_id expires=1h;// In ColdFusion Admin:
// Server Settings > Memory Variables
// Enable: "Use J2EE session variables"
// Provides standard servlet session
// Note: Redis session storage cannot be used with J2EE sessionsPrevention
External session storage from start, minimize session data, regular cluster testing, monitor replication logs
Unauthorized CFIDE Access
highSymptoms
- Security scan finds CFIDE exposed
- Administrator accessible from internet
- Debug output visible externally
- RDS ports accessible
Diagnosis Steps
- Test external access to /CFIDE/administrator
- Check web server virtual host configs
- Review IP restriction settings
- Scan for exposed ports (8500 and the AJP port from server.xml)
- Check debug output settings
Solutions
// In Apache config or .htaccess
<LocationMatch "^/CFIDE/(administrator|adminapi|componentutils)">
Require ip 127.0.0.1
Require ip 192.168.1.0/24
Require ip 10.0.0.0/8
</LocationMatch>
// Restart Apache
sudo systemctl restart apache2// In web.config for CFIDE directory
<configuration>
<system.webServer>
<security>
<ipSecurity allowUnlisted="false">
<add allowed="true" ipAddress="127.0.0.1" />
<add allowed="true" ipAddress="192.168.1.0" subnetMask="255.255.255.0" />
</ipSecurity>
</security>
</system.webServer>
</configuration>// In CF Admin: Debugging & Logging > Debug Output Settings
// Enable: "Display debug output"
// Restrict to IP addresses:
127.0.0.1
192.168.1.0/24
// Or in Application.cfc
this.debuggingIPAddresses = "127.0.0.1,192.168.1.100";// Linux firewall (iptables)
sudo iptables -A INPUT -p tcp --dport 8500 -s 127.0.0.1 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 8500 -j DROP
// Replace AJP_PORT with the port from server.xml
sudo iptables -A INPUT -p tcp --dport AJP_PORT -j DROP
// Make persistent
sudo iptables-save > /etc/iptables/rules.v4Prevention
Run Lockdown Guide on install, regular security scans, IP whitelisting from start, never expose CF ports
Stuck on something not listed here?
Some problems don't fit neat categories. Convective's team has been troubleshooting ColdFusion for over 20 years. If it can go wrong, we've probably fixed it before.
Get Expert Support