Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2005 16:36:04 +0200
From:      "Conrad Burger" <conrad.burger@swistgroup.com>
To:        <freebsd-java@freebsd.org>
Subject:   Tomcat 5.5 --- tomcat55ctl --- increase max vm heap space ?
Message-ID:  <88B5DDE8C1A06741B754B910DE2DEFBB49AA2A@HERMES.swistgroup.com>

next in thread | raw e-mail | index | archive | help
************************************************************
Click here to view our e-mail legal notice: 
http://www.swistgroup.com/email.htm or call: +27 21 888 7920
************************************************************
Hi all=20

I needed to increase the maximum allowed heap space for the vm tomcat is =
running
on. This was achieved by using the -Xmx switch (eg. -Xmx512m).

>From what I can see there is no way to add this switch if you want to =
use
"tomcat55ctl".

Modified the daemonctl.c and Tomcat 5.5 Makefile to get it working.
=20
My question... I don't want to perform this "hack" operation every time =
I
install tomcat on a machine or update the ports tree.
Would it be possible to add some variable, where passing arbitrary vm =
arguments
to the tomcat vm can be done at port build time?

Eg.  Tomcat5.5/Makefile

--- Makefile    Wed Jul 20 16:12:59 2005
***************
*** 45,50 ****
--- 45,51 ----
  STDERR_LOG=3D   ${LOG_DIR}/stderr.log
  AUTO_START?=3D  NO
  STOP_TIMEOUT?=3D        5
+ JAVA_VM_ARGS?=3D         -Xmx512m
  PID_FILE=3D     /var/run/${APP_SHORTNAME}.pid
  REPLACE_FILES=3D        =
${PORTSDIR}/www/jakarta-tomcat4/files/daemonctl.c \
                ${PORTSDIR}/www/jakarta-tomcat4/files/daemonctl.1 \
***************
*** 109,114 ****
--- 110,116 ----
        -e "/%%STOP_TIMEOUT%%/s//${STOP_TIMEOUT}/g" \
        -e "/%%USER%%/s//${USER}/g" \
        -e "/%%WARP_PORT%%/s//${WARP_PORT}/g" \
+       -e "/%%JAVA_VM_ARGS%%/s//${JAVA_VM_ARGS}/g" \
        $f > ${WRKDIR}/`basename $f`
        @${ECHO_MSG} " [ DONE ]"
  .endfor


Eg. daemonctl.c
--- daemonctl.c Wed Jul 20 13:06:57 2005
***************
*** 425,431 ****
                         file using pipe(2) */

                /* Execute the command */
!               execl("%%JAVA_HOME%%/%%JAVA_CMD%%",
"%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", =
%%JAR_ARGS%%
NULL);

                fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to =
start
%%APP_TITLE%% %%PORTVERSION%% since '%%JAVA_HOME%%/%%JAVA_CMD%% -jar
%%JAR_FILE%%' in %%APP_HOME%%: ");
                perror(NULL);
--- 425,431 ----
                         file using pipe(2) */

                /* Execute the command */
!               execl("%%JAVA_HOME%%/%%JAVA_CMD%%",
"%%JAVA_HOME%%/%%JAVA_CMD%%","%%JAVA_VM_ARGS%%", "-jar", %%JAVA_ARGS%%
"%%JAR_FILE%%", %%JAR_ARGS%% NULL);

                fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to =
start
%%APP_TITLE%% %%PORTVERSION%% since '%%JAVA_HOME%%/%%JAVA_CMD%% -jar
%%JAR_FILE%%' in %%APP_HOME%%: ");
                perror(NULL);


Cheers=20
Conrad Burger




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?88B5DDE8C1A06741B754B910DE2DEFBB49AA2A>