Settings for JVM parameters in the JBoss server:
There is such a setting in run.sh under $jboss_home/bin:
Java code
- # force IPV4 in Linux systems since IPv6 doesn ' t work correctly with JDK5 and lower
- If [ "$linux" = "true"]; Then
- java_opts="-xms128m-xmx512m-dsun.rmi.dgc.client.gcinterval=3600000-dsun.rmi.dgc.server.gcinterval=3600000"
- Fi
This parameter is the parameter that sets the Java VM. We can modify this parameter here, but more generally we will set the parameters of the Java VM in run.conf and refer to it here.
The above can be modified as follows
Java code
- # force IPV4 in Linux systems since IPv6 doesn ' t work correctly with JDK5 and lower
- # If java_opts is not setted in run.conf, setting here; by Djq
- If [ "x$java_opts" = "x"]; Then
- java_opts="-xms128m-xmx512m-xx:permsize=64m-xx:maxpermsize=256m-xx:+heapdumponoutofmemoryerror- dsun.rmi.dgc.client.gcinterval=3600000-dsun.rmi.dgc.server.gcinterval=36000 "
- Fi
- If [ "$linux" = "true"]; Then
- java_opts="$JAVA _opts-djava.net.preferipv4stack=true"
- Fi
And we need to be able to set the parameters of the Java VM separately in the run.conf. (In general, we do not need to make any changes in the run.sh, as long as the run.conf inside to ensure that all the parameters are OK).
Report:
A setting for run.conf:
Java code
- # #-*-Shell-script-*-######################################################
- ## ##
- # # JBoss Bootstrap Script Configuration # #
- ## ##
- ##############################################################################
- # # # $Id: run.conf 62747 2007-05- :43:36z Dimitris@jboss. org $
- #
- # this file is optional; It is removed if not needed.
- #
- #
- # Specify the maximum file descriptor limit, use ' max ' or ' maximum ' to use
- # The default, as queried by the system.
- #
- # Defaults to "Maximum"
- #
- #MAX_FD ="Maximum"
- #
- # Specify the profiler configuration file to load.
- #
- # Default is to not load Profiler configuration file.
- #
- #PROFILER =""
- #
- # Specify the location of the Java home directory. If set then $JAVA would
- # is defined to $JAVA _home/bin/java, else $JAVA would be "JAVA".
- #
- #JAVA_HOME ="/opt/java/jdk"
- #set Java_home here; by DJQ
- Java_home="/jboss/jdk1.5.0_22"
- #
- # Specify the exact Java VM executable to use.
- #
- #JAVA =""
- #
- # Specify options to pass to the Java VM.
- #
- #If [ "x$java_opts" = "x"]; Then
- # java_opts="-xms128m-xmx512m-dsun.rmi.dgc.client.gcinterval=3600000-dsun.rmi.dgc.server.gcinterval=3600000 "
- #fi
- # Set options for the JVM; by DJQ
- If [ "x$java_opts" = "x"]; Then
- java_opts="-xms1024m-xmx6120m-xx:permsize=128m-xx:maxpermsize=512m-xx:+heapdumponoutofmemoryerror- dsun.rmi.dgc.client.gcinterval=3600000-dsun.rmi.dgc.server.gcinterval=36000 "
- Fi
- # Sample JPDA settings for remote socket debuging
- #JAVA_OPTS ="$JAVA _opts-xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
- # Sample JPDA settings for shared memory debugging
- #JAVA_OPTS ="$JAVA _opts-xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"
Java VM parameter settings at JBoss startup