title: Out of memory in SOAPMessage countAttachments API
body: <p>SOAP message has been constructed from HttpServletRequest's input stream with API</p>
  
  <pre><code>SOAPMessage message = messageFactory.createMessage(soapHeader, 
                             request.getInputStream());
  </code></pre>
  
  <p>When max memory allotted to the process is -Xmx1024m and when memory snapshot of the process shown 100m, the following call</p>
  
  <pre><code>message.countAttachments()
  </code></pre>
  
  <p>threw out of memory exception</p>
  
  <p>Platform: Windows 7 64bit, Java JDK1.6 update 25</p>