users@glassfish.java.net

Re: Glassfish Memory Issues

From: <Jan.Luehe_at_Sun.COM>
Date: Thu, 12 Jul 2007 18:25:37 -0700

Scott Oaks wrote:

>On Thu, 2007-07-12 at 15:57, ITVGuy2000 wrote:
>
>
>>Scott, thanks a lot.
>>
>>
>>sdo wrote:
>>
>>
>>>I actually prefer running completely out of phyiscal memory (which is what
>>>you're doing;
>>>the 1GB of swap is your physical memory). So again, JDK 6 is your friend
>>>here.
>>>
>>>
>>>
>>What about JDK 6 is a benefit here?
>>
>>
>
>It's the same reason -- because JDK 6 will compile the JSPs in process,
>it will not need to fork the JSP compiler, drastically reducing your
>memory requirements.
>
>
>

Just FYI: If you're stuck with JDK 1.5 for whatever reason, you can
still avoid the forking by setting the "fork" init parameter of the
JspServlet
to false.

This can be done globally in default-web.xml, by adding:

    <init-param>
      <param-name>fork</param-name>
      <param-value>false</param-value>
    </init-param>

to the declaration of the JspServlet:

  <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    ...
    <init-param>
      <param-name>fork</param-name>
      <param-value>false</param-value>
    </init-param>
    ...
  </servlet>

or on a per-webapp basis (in sun-web.xml).


Jan