title: Why do I get java.lang.OutOfMemory Error?
body: <p>I have a server that handles requests via a socket and spawns a thread to handle each request.</p>
  
  <p>Why do I get a <code>java.lang.OutOfMemoryError</code> and what can I do to fix it?</p>