dcsimg
OutOfMemoryError : unable to create new native thread
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ian_simpson
Posted On:   Wednesday, November 6, 2002 12:25 PM

I am using 1.3.1_06 on Sparc with Xmx Xms =2700m on a machine with 8g physical RAM. I am running an app with 1000 threads and frequently encouter the error "OutOfMemoryError: unable to create new native thread". I am aware that the maximum addressable memory space in 1.3.1 is 4g and from my understanding is that the thread stacks are created in the memory space addressable by the VM that is in the headroom above my heap (the 2700m of space reserved by Xmx), but within the 4g of addressable memory space. Sun Java documentation indicates that the default thread stack size on Sparc for 1.3.1 is 512m. If I have 1000 threads that means I need 500m of headroom. I have left 1.3g and I still get "OutOfMemory   More>>

I am using 1.3.1_06 on Sparc with Xmx Xms =2700m on a machine with 8g physical RAM. I am running an app with 1000 threads and frequently encouter the error "OutOfMemoryError: unable to create new native thread".




I am aware that the maximum addressable memory space in 1.3.1 is 4g and from my understanding is that the thread stacks are created in the memory space addressable by the VM that is in the headroom above my heap (the 2700m of space reserved by Xmx), but within the 4g of addressable memory space.



Sun Java documentation indicates that the default thread stack size on Sparc for 1.3.1 is 512m. If I have 1000 threads that means I need 500m of headroom. I have left 1.3g and I still get "OutOfMemoryError: unable to create new native thread" errors.



I have used -XX:ThreadStackSize to clamp down on my per thread stack size but I then encountered silent application errors which cause erradict unacceptable behaviour.



I would like to precisely understand how the JRE uses the addressable memory space above Xmx and within the 4g limit.



I am using -XX:-UseTLE as well but have played with this in test programs and it doesn't seem to have an effect on the available headroom for threads.

   <<Less

Re: OutOfMemoryError : unable to create new native thread

Posted By:   Christopher_Schultz  
Posted On:   Friday, November 8, 2002 12:38 PM

All UNIX systems ahve a thread limit for each process. Perhaps yours defaults to 1024 (very close to your normal load). Consider increasing your maximum per-process thread count. What do you need so many threads for?



-chris
About | Sitemap | Contact