Tomcat 5.5 --- tomcat55ctl --- increase max vm heap space ?

Conrad Burger conrad.burger at swistgroup.com
Wed Jul 20 14:36:12 GMT 2005


************************************************************
Click here to view our e-mail legal notice: 
http://www.swistgroup.com/email.htm or call: +27 21 888 7920
************************************************************
Hi all 

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.
 
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=   ${LOG_DIR}/stderr.log
  AUTO_START?=  NO
  STOP_TIMEOUT?=        5
+ JAVA_VM_ARGS?=         -Xmx512m
  PID_FILE=     /var/run/${APP_SHORTNAME}.pid
  REPLACE_FILES=        ${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 
Conrad Burger



More information about the freebsd-java mailing list