Skip to main content
September 5, 2010
Question

Coldfusion 9 scheduled task is not running and mail connection failed

  • September 5, 2010
  • 2 replies
  • 2574 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
    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
    September 8, 2010

    Hi Charlie,

    Here is the screen shot.


    Well, that helps to confirm that there's nothing else running using a lot of memory, and as I said in the last note it wasn't that that would even be a cause of your particular error ("unable to create new native threads"), but I thought it worth checking.

    That said, keep in mind as well that this screenshot if a snapshot of how things are at this time, not during the problem. Keep that in mind. You'll want to capture such info when the problem is happening (and not even after a restart of CF or any other big change). That's a challenge of solving some problems--capturing info "in the moment".

    So back to your "unable to create new native threads", again the question will be how the use of memory looks for CF during that time. Unfortunately, looking at it in Task Manager isn't too valuable, since it just shows the total memory used, not the parts within (heap, stack, permgen, code spaces). There's a relatively new tool out that may help you getting that info, called cftracker (http://www.cftracker.net/). You may want to consider that to help you with diagnostics. Besides an option to track the different memory space usage, it also has an option to log the memory use over time.

    /charlie

    /Charlie (troubleshooter, carehart. org)