Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
the server is 2.4 Ghz with 4GB of Ram and is wmware machine.
Copy link to clipboard
Copied
Please click the "show processes from all users" and take another screenshot.
/charlie
Copy link to clipboard
Copied
Hi Charlie,
Here is the screen shot.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi,
Thanks for all your help and advise.
Anyway, I found out that third party SFTP component might be the culprit for this error. Since I used it from CF6 and I think it not really compatible to CF9.
I am now developing using native CFFTP and I hope this would solve my problem.
Thanks again.
Eric
Copy link to clipboard
Copied