java.lang.OutOfMemoryError: unable to create new native thread

In tests that were done a couple years ago with ColdFusion MX, it was found that there is an upper limit on the number of operating system threads that can be open by one process, not to be confused with the number of file handle descriptors or jvm threads. When that os thread limit is reached for ColdFusion jrun process, the java.lang.OutOfMemoryError: unable to create new native thread error is thrown.

The results from testing on the Linux platform with Red Hat 7.x demonstrated the error when approximately 400 OS threads were tied to one OS process, the jvm process. Current Linux versions are thought to have improved that somewhat, so the limit might be higher at this time.

Solaris also demonstrated a limit, but had a higher threshold of about 1000-2000 OS threads per process, and Windows showed a limit of about 3000. at that time.

Given that for the JVM process under ColdFusion/JRun there is at least one operating system thread open for every JVM web thread, plus other operating system threads that are not tied to a JVM web thread, it is very likely that this error will occur if the total number of web threads (queued + running) begin to approach that experimental threshold of about 400 on Linux, for example.

[More]

activeHandlerThreads or Simultaneous Requests: Less is More

I'm recycling this explanation which I just emailed to someone about why setting the JRun activeHandlerThreads value in jrun.xml to 500 is not a good idea. To ColdFusion users this setting is better known as Simultaneous Requests.

Current values that you've set for the ColdFusion server's JRunProxyService in jrun.xml are far from default

500
Maximum number of web threads that are actively running.



1000
Maximum number of web threads queued + running



100
Minimum number of web threads to have around at all times


As a rule of thumb, I recommend that you set these to:

[More]