title: EXCEPTION_STACK_OVERFLOW using JAX-WS
body: <p>Basically I have a JAW-WS web service. I call this millions of times, in batch, from an external application. After around 20 million calls the application crashes with the error below. I have tried upgrading the java version, trying on different machines and its all the same. </p>
  
  <blockquote>
    <p>An unrecoverable stack overflow has occurred.</p>
    
    <p>A fatal error has been detected by the Java Runtime Environment:</p>
    
    <p>EXCEPTION_STACK_OVERFLOW (0xc00000fd) at pc=0x7c90e8e5, pid=9396,
    tid=9000</p>
    
    <p>JRE version: 6.0_29-b11  Java VM: Java HotSpot(TM) Client VM
    (20.4-b02 mixed mode, sharing windows-x86 )  Problematic frame:  C
    [ntdll.dll+0xe8e5]</p>
    
    <p>An error report file with more information is saved as:  U:
    hs_err_pid9396.log</p>
    
    <p>If you would like to submit a bug report, please visit: 
    <a href="http://java.sun.com/webapps/bugreport/crash.jsp" rel="nofollow">http://java.sun.com/webapps/bugreport/crash.jsp</a></p>
  </blockquote>
  
  <p>I have read that <code>EXCEPTION_STACK_OVERFLOW</code> are caused by recursive, or nested function that do not return correctly. I don't think this is the issue my case as I only have one call that does some work and returns. Silly question but is there a way of clearing the stack, maybe I can do this every x hours?</p>
  
  <p>I managed to get a clean installation of server 2008 and the latest JRE. when i run the same application on this machine i get the below message. im sure it better to look at this error than the last as this is the live box the application will be deployed on. Thanks</p>
  
  <p>28-Dec-2011 14:34:58 com.sun.xml.internal.ws.model.RuntimeModeler getRequestWrap</p>
  
  <pre><code>perClass
  INFO: Dynamically creating request wrapper Class Professional
  Services.jaxws.CleanResponse
  28-Dec-2011 14:34:58 com.sun.xml.internal.ws.model.RuntimeModeler getResponseWra
  pperClass
  INFO: Dynamically creating response wrapper bean Class Professional
  Services.jaxws.CleanResponse
  Exception in thread "Thread-4" java.lang.OutOfMemoryError: unable to create new
  native thread
          at java.lang.Thread.start0(Native Method)
          at java.lang.Thread.start(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(Unk
  nown Source)
          at java.util.concurrent.ThreadPoolExecutor.execute(Unknown Source)
          at sun.net.httpserver.ServerImpl$Dispatcher.handle(Unknown Source)
          at sun.net.httpserver.ServerImpl$Dispatcher.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
  </code></pre>