ColdFusion MX: CreateUUID increases the Windows system clock speed
Issue
Calling the createUUID function multiple times under load in Macromedia ColdFusion MX and higher can cause the Windows system clock to accelerate. This is an issue with the Java Virtual Machine (JVM) in which Thread.sleep calls less than 10 milliseconds (ms) causes the Windows system clock to run faster. This behavior was originally filed as Sun Java Bug 4500388 (developer.java.sun.com/developer/bugParade/bugs/4500388.html) and has been confirmed for the 1.3.x and 1.4.x JVMs.
In ColdFusion MX, the createUUID function has an internal Thread.sleep call of 1 millisecond. WhencreateUUID is heavily utilized, the Windows system clock will gain several seconds per minute. The rate of acceleration is proportional to the number ofcreateUUID calls and the load on the ColdFusion MX server. Macromedia has observed this behavior in ColdFusion MX and higher on Windows XP, 2000, and 2003 systems.
Solution
ColdFusion MX users have two workaround options:
Using JVM arguments
Sun's recommended bug fix is to pass the following flag as an argument to the JVM: -XX:+ForceTimeHighResolution.
Use the following steps to implement this flag in ColdFusion MX server configuration:
- Open the ColdFusion Administrator.
- Choose the "Java and JVM" link in the left frame.
- Add
-XX:+ForceTimeHighResolutionto the JVM arguments text box. - Click the Submit Changes button.
- Restart ColdFusion MX.
For the ColdFusion MX J2EE configuration, add the flag using your J2EE server's configuration interface.
Using code
Since this is a problem with the underlying JVM and a system call in the createUUID function, developers can either create their own UUID generation code or download similar code from the ColdFusion Exchange.
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
