users@jax-rpc.java.net

Re: How to increase memory for Tomcat process?

From: Baltz, Kenneth <Kbaltz_at_FIRSTAM.COM>
Date: Thu, 14 Nov 2002 10:03:18 -0800

We're setting it through an entry in setenv.sh

The contents of setenv.sh:
JAVA_HOME="/usr/java1.2/jre"
UNINSTALL_JAR_FILE="/usr/local/jwsdp-1_0_01/_uninst/uninstall.jar"
CATALINA_OPTS="-server -Xmx512m -Xms128m"

The last two entries in CATALINA_OPTS are supposed to set the max and min
memory for the JVM. We're testing the effectiveness of this setting through
the following .jsp:


mem.jsp:
<h1>Memory Status:</h1>
<%
  boolean collected = false;
  if (request.getParameter("gc") != null) {
    System.gc();
    collected = true;
  }

  out.println("<HR>");
  Runtime rt = Runtime.getRuntime();
  long tm = rt.totalMemory(),
       mm = rt.maxMemory(),
       fm = rt.freeMemory();

  out.println("Max memory: "+mm+" ("+mm/1024/1024+"MB)<BR>");
  out.println("Total Memory: "+tm+" ("+tm/1024/1024+"MB)<BR>");
  out.println("Free memory: "+fm+" ("+fm/1024/1024+"MB)<BR>");


%>

In our case, I would expect to see Max memory at 512MB, but instead it's
always at 128MB, the JVM default.

K.C. Baltz

> -----Original Message-----
> From: Doug Kohlert [mailto:doug.kohlert_at_SUN.COM]
> Sent: Thursday, November 14, 2002 9:37 AM
> To: JAXRPC-INTEREST_at_JAVA.SUN.COM
> Subject: Re: How to increase memory for Tomcat process?
>
>
> K.C.
> To help us solve you problem more quickly, what technique do
> you use to adjust
> the JVM memory allocation for Tomcat standalone?
>
> Baltz, Kenneth wrote:
> > This is slightly off-topic, and for that I apologize.
> We're frequently
> > running out of memory with the Tomcat that ships with
> JWSDP. I know how
> > to adjust the JVM memory allocation for Tomcat standalone, but that
> > method doesn't seem to work with the JWSDP version and its custom
> > launcher. Anyone know how?
> >
> > K.C. Baltz
> >
>
>
> --
> Doug Kohlert
> Java Software Division
> Sun Microsystems, Inc.
> phone: 503 345-9806
>