Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Threads and Synchronization and the fly likes Unable to create native thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Unable to create native thread" Watch "Unable to create native thread" New topic

Unable to create native thread

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1404
I ran the particular thread after sleeping of 1 minute. But after 68 minutes, it shows Unable to create native thread. java.lang.OutOfMemoryError
Kash Mhai

Joined: Apr 01, 2005
Posts: 29
Maybe sharing the code might help. What is the thread doing exactly?

-------------<br />There are wheels within wheels...<br />P.G Wodehouse
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1404
I am sending JMS message to the Queue every 1 minute
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

Although the error message mentions threads, this really has nothing to do with threads, per se. You're simply running out of memory. WHatever you're doing once a minute is creating some number of objects, and at least some of them are being stored somewhere and not released. Examine your code for evidence of this.

[Jess in Action][AskingGoodQuestions]
Thomas Hale

Joined: Apr 05, 2005
Posts: 3

You are either running out of memory for real, or running out of process address space.

Good luck.

setting your Thread Stack Size to a value lower than 1 mb might help you.. but if you are leaking threads fix that instead and don't sweat it.


Should be adequate... if you are running java 1.4.2 or higher on HP or Sun
I agree. Here's the link:
subject: Unable to create native thread
jQuery in Action, 3rd edition