• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to create native thread  RSS feed

 
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran the particular thread after sleeping of 1 minute. But after 68 minutes, it shows Unable to create native thread. java.lang.OutOfMemoryError
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe sharing the code might help. What is the thread doing exactly?
 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sending JMS message to the Queue every 1 minute
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!