Meaningless Drivel is fun!*
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
Author

Unable to create native thread

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1371
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
Greenhorn

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: 1371
I am sending JMS message to the Queue every 1 minute
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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
Greenhorn

Joined: Apr 05, 2005
Posts: 3
Kri,


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.

-XX:ThreadStackSize=256

Should be adequate... if you are running java 1.4.2 or higher on HP or Sun
 
Consider Paul's rocket mass heater.
 
subject: Unable to create native thread
 
Similar Threads
configuring JVM parameters
Max number of threads in a JVM
Somany Timer Threads are creating in Jboss 4.2.
Stack Size : java.lang.OutOfMemoryError: unable to create new native thread
unable to create new native thread