# Can't create a new thread (errno 12)

**URL:** <https://www.ruby-forum.com/t/cant-create-a-new-thread-errno-12/177084>\
**Category:** Rails\
**Created:** [October 11, 2009, 9:08am UTC](https://www.ruby-forum.com/t/cant-create-a-new-thread-errno-12/177084 "2009-10-11T09:08:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sathish](https://www.ruby-forum.com/u/sathish)\
**Post date:** [October 11, 2009, 9:08am UTC](https://www.ruby-forum.com/t/cant-create-a-new-thread-errno-12/177084/1 "2009-10-11T09:08:49Z")

</div>

Hi All,

I’m facing the error in mysql - “Can’t create a new thread (errno 12);  
if you are not out of available memory, you can consult the manual for a  
possible OS-dependent bug”

Also, It throws the error like,

"090925 20:50:53 [ERROR] /usr/sbin/mysqld: Out of memory (Needed 1048583  
bytes)  
090925 22:09:52 [ERROR] /usr/sbin/mysqld: Out of memory (Needed 132176  
bytes) "

I those, Mysql asked me to use the ulimit to increase the size of its  
elements to avoid these kind of problems,  
so that, I have increased the open files limit in ulimit. it was 1024  
before I changed as 2048.

Even so, My problem is not solved, When the mysql thread connection  
increases because of lot of request to my application, Mysql starts to  
throw this error.

I don’t know how to solve this problem yet. As of now, I have decreased  
my wait\_timeout as 10 sec. from 180 sec.

Please guide me through to get rid of this issue.

Thanks in Advance,  
Sathish K.
