Skip to main content
September 5, 2010
Question

Coldfusion 9 scheduled task is not running and mail connection failed

  • September 5, 2010
  • 2 replies
  • 2575 views

In my CF9, scheduled task able to running as normal and mail connection is connected but after sometimes (estimate 2 hours) these scheduled task stopped working and mail connection is failed.

All I need to do is reboot the server and everything back to normal but after 2-3 hours, it back to old sickness.

Here extra info from log:

1. Error while executing task unable to create new native thread

2. unable to create new native thread

I am running Coldfusion 9 on Win2K3 server with SSL.

Please help.

Thanks in advance,

Eric

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    September 7, 2010
    Charlie Arehart
    Community Expert
    Community Expert
    September 6, 2010

    Without elaborating too much, the "unable to create new native thread" can mean that there's not enough memory space to create a new thread. That memory space (called the stack space) is separate from the heap (whose max size you can control). If this is a 32bit Win2k3, the problem may be that the sum of your heap and permgen and other spaces is not leaving enough stack space when the JVM needs it.

    As such, in cases like that, the simplest solution is in fact to lower the heap space (the xmx jvm argument) so that you leave more space for the stack. As long as you have no indications of running out of heap space (outofmemory heap space errors in those same logs).

    Note that you cannot control the maximum size of the stack space, as you can the heap and permgen. Now, some may want to point out that you can at least control the size of each stack entry (with the xss jvm argument), but it's not clear from any docs I've found what the default value is, so you won't know if changing it is increasing or decreasing the size. I have found from reading lots of docs that the default xss value has changed in different jvm versions and on different OS's. That's why I suggest that lowering the heap may be the simplest solution. It's worked for others who I have counseled.

    Let us know if it works for you.

    /charlie

    Providing CF troubleshooting services at carehart.org/consulting

    charlie@carehart.org

    /Charlie (troubleshooter, carehart. org)
    September 6, 2010

    Hi Charlie,

    Thanks for the suggestion and sorry I am quite new to coldfusion.

    Currently my Minimum JVM Heap Size (MB) is blank and Maximum JVM Heap Size (MB) is 512.

    I think this is default, if not mistaken.

    Please advise and many thanks in advance.

    Eric

    Charlie Arehart
    Community Expert
    Community Expert
    September 6, 2010

    Yes, 512 is the default, and really, I would be surprised that you'd run out of heap space with the heap that small. I mentioned that I wasn't elaborating as much as I could in the last note. Another thing that could be happening is that you could have something causing an inordinate number of stack space entries being created. There needs to be one for each thread, and there could be hundreds of threads running normally, so I'd think you'd have to have something causing thousands of them for that to be the issue.

    Out of curiosity, how much memory you have on the machine? If it's Windows, look at the Control Panel > System page. You can also confirm there if this is a 32-bit machine. Then look at Task Manager (Ctrl-shift-esc) to see what else is using memory, both to see how much memory is in use (reported at the bottom of the processes or performance tabs) and if any other apps are using a lot of memory. There's a chance that something else on the box (like a database server) could be using a lot of memory, and thus stealing what's available to CF. That would normally result in a different error (out of swap space, which doesn't quite mean what most suspect), but anyway, since you're struggling, it's worth checking.

    /charlie

    Providing CF troubleshooting services at carehart.org/consulting

    charlie@carehart.org

    /Charlie (troubleshooter, carehart. org)