Thursday, 3 November 2011

Troubleshooting technique Garbage Collector


  • Troubleshooting Technique: Garbage Collector
  • Sun documentation on garbage collection
Each thread in the VM get's a stack. The stack size will limit the number of threads that you can have, too big of a stack size and you will run out of memory as each thread is allocated more memory than it needs.
The Resin startup scripts (httpd.exe on Windows, wrapper.pl on Unix) will set the stack size to 2048k, unless it is specified explicity. 2048k is an appropriate value for most situations.
JVM option passed to Resin
Meaning
-Xss
the stack size for each thread
-Xss determines the size of the stack: -Xss1024k. If the stack space is too small, eventually you will see an exception class java.lang.StackOverflowError .
Some people have reported that it is necessary to change stack size settings at the OS level for Linux. A call to ulimit may be necessary, and is usually done with a command in /etc/profile:
Limit thread stack size on Linux
ulimit -s 2048

No comments:

Post a Comment