-
1. Re: Native thread creation and Stack Overflow Exceptions: So
camel Mar 3, 2004 7:29 PM (in response to clajoie)1024K stack? Isn't that a bit large? I think the default stack size is around 64K or 96K, depending on your JVM version. I think that setting is the stack size per-thread (someone correct me if I'm wrong!).
See the volano report http://www.volano.com/report/. Here's an excerpt:The main trick in getting these Java platforms to handle the required number of threads is to reduce the size of the thread stack with the -Xss option. I generally set the stack size to 32 kilobytes when permitted by the Java virtual machine on startup. Otherwise, I set the stack size to the minimum required by the virtual machine: 64 kilobytes for the HotSpot Server VM on Solaris and 96 kilobytes for the version 1.4.1 HotSpot Server VM on Linux and FreeBSD.
What happens if you try your setup with -Xss96K -
2. Re: Native thread creation and Stack Overflow Exceptions: So
clajoie Mar 4, 2004 6:45 AM (in response to clajoie)Yes, 1MB does seem like a lot, but the default is 2MB on a linux system. A stack size of 96k doesn't even allow the JVM to start, 128k and 256k and you encounter random stack overflow errors. Still testing 512 and 768, but 1024 has been reported by a number of people on here as the "magic" number. So we're using it to be on the safe side.
You are correct though, that is the stack size per thread. -
3. Re: Native thread creation and Stack Overflow Exceptions: So
juha Mar 4, 2004 1:17 PM (in response to clajoie)Hello Chad,
added this entry to Wiki where it will be more accessible to people.
Thanks, -
4. Re: Native thread creation and Stack Overflow Exceptions: So
clajoie Mar 8, 2004 2:55 PM (in response to clajoie)Some additional testing indicates that a stack size of 512k works fine for our apps. This may not be the case for all applications, but it does for us.