File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 1378
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: 1378
I am sending JMS message to the Queue every 1 minute
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to create native thread