You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lane <la...@joeandlane.com> on 2005/05/22 23:14:30 UTC

OutOfMemory on FreeBSD

Hello,

I'm trying to find how to send jvm parameters (-Xm128m) to the JVM during 
tomcat startup.  I have an application (openreports) that fails with 
outofmemory exception intermittently.

I have seen some references here and there, but nothing that indicates which 
tomcat (or java, [or freebsd]) configuration file that I need to touch.

Any pointers are appreciated.

thanks,

lane

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: OutOfMemory on FreeBSD

Posted by QM <qm...@brandxdev.net>.
On Sun, May 22, 2005 at 04:14:30PM -0500, Lane wrote:
: I'm trying to find how to send jvm parameters (-Xm128m) to the JVM during 
: tomcat startup.  I have an application (openreports) that fails with 
: outofmemory exception intermittently.

You can set the environment variable JAVA_OPTS, e.g.
	export JAVA_OPTS='-Xm128m'

Note that this would require writing a wrapper script to call the Tomcat
scripts, since it'd be silly to do this by hand all the time.

The extra script may sound like a pain, but it actually makes your setup
less sensitive to Tomcat upgrades because you won't have to modify
anything in the Tomcat tree.

-QM


-- 

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: OutOfMemory on FreeBSD

Posted by Lane <la...@joeandlane.com>.
Hey, I guess I can answer my own question!  Don't you just love it when that 
happens!

The makefile for tomcat5 on FreeBSD doesn't give the option to add additional 
parameters.  There is probably a better way to do this than to hard-code more 
variables, but I'm not sure how to do it.  So for anyone else who runs into 
OutOfMemory exceptions on FreeBSD or the dreaded "Can't connect to X DISPLAY" 
error, make these changes to /usr/ports/www/jakarta-tomcat5/Makefile:

In the do-install target: 

change: 

-e "/%%JAVA_ARGS%%/s//\"-Dcatalina.home=${APP_HOME:S/\//\\\//g}\",/g" \

to:

-e "/%%JAVA_ARGS%%/s//\"-Djava.awt.headless=true\",\"-Xms128m\",\"-Xmx256m\",
\"-Dcatalina.home=${APP_HOME:S/\//\\\//g}\",/g" \

then do:

make -DFORCE_PKG_REGISTER do-install

This will overwrite the current tomcat50ctl but will preserve your existing 
tomcat installation.


PortMaintainer:  Kang Liu  - which email address is correct for you?  both 
liukang@bjpu.edu.cn and  liukang@bjut.edu.cn appear 
in /usr/ports/www/jakarta-tomcat5/Makefile

lane

On Sunday 22 May 2005 16:14, Lane wrote:
> Hello,
>
> I'm trying to find how to send jvm parameters (-Xm128m) to the JVM during
> tomcat startup.  I have an application (openreports) that fails with
> outofmemory exception intermittently.
>
> I have seen some references here and there, but nothing that indicates
> which tomcat (or java, [or freebsd]) configuration file that I need to
> touch.
>
> Any pointers are appreciated.
>
> thanks,
>
> lane
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org