Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here's what the Tomcat guys have to say:</p> <blockquote> <p>An Out Of Memory can be thrown by several causes:</p> <ul> <li><p>A servlet trying to load a several GBytes file into memory will surely kill the server. These kind of errors must be considered a simple bug in our program.</p></li> <li><p>To compensate for the data your servlet tries to load, you increase the heap size so that there is no room to create the stack size for the threads that need to be created. The memory required by each thread will vary by OS but can be as high as 2M by default and in some OS's (like Debian Sarge) is not reducible with the <code>-Xss</code> parameter. 1 Rule of Thumb, use no more than 1G for heap space in a 32-bit web application.</p></li> <li><p>Deep recursive algorithms can also lead to Out Of Memory problems. In this case, the only fixes are increasing the thread stack size (<code>-Xss</code>), or refactoring the algorithms to reduce the depth, or the local data size per call.</p></li> <li><p>A webapp that uses lots of libraries with many dependencies, or a server maintaining lots of webapps could exhauste the JVM PermGen space. This space is where the VM stores the classes and methods data. In those cases, the fix is to increase this size. The Sun VM has the flag <code>-XX:MaxPermSize</code> that allows to set its size (the default value is 64M)</p></li> <li><p>Hard references to classes can prevent the garbage collector from reclaiming the memory allocated for them when a <code>ClassLoader</code> is discarded. This will occur on JSP recompilations, and webapps reloads. If these operations are common in a webapp having these kinds of problems, it will be a matter of time, until the PermGen space gets full and an Out Of Memory is thrown.</p></li> </ul> </blockquote> <p><strong>Source:</strong> <a href="http://wiki.apache.org/tomcat/OutOfMemory" rel="noreferrer">Tomcat Wiki: OutOfMemory</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload