Java VM parameter settings at JBoss startup

Source: Internet
Author: User
Tags jboss jboss server

Settings for JVM parameters in the JBoss server:

There is such a setting in run.sh under $jboss_home/bin:

Java code
    1. # force IPV4 in Linux systems since IPv6 doesn ' t work correctly with JDK5 and lower
    2. If [ "$linux" = "true"]; Then
    3. java_opts="-xms128m-xmx512m-dsun.rmi.dgc.client.gcinterval=3600000-dsun.rmi.dgc.server.gcinterval=3600000"
    4. 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
  1. # force IPV4 in Linux systems since IPv6 doesn ' t work correctly with JDK5 and lower
  2. # If java_opts is not setted in run.conf, setting here; by Djq
  3. If [ "x$java_opts" = "x"]; Then
  4. java_opts="-xms128m-xmx512m-xx:permsize=64m-xx:maxpermsize=256m-xx:+heapdumponoutofmemoryerror- dsun.rmi.dgc.client.gcinterval=3600000-dsun.rmi.dgc.server.gcinterval=36000 "
  5. Fi
  6. If [ "$linux" = "true"]; Then
  7. java_opts="$JAVA _opts-djava.net.preferipv4stack=true"
  8. 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
  1. # #-*-Shell-script-*-######################################################
  2. ##                                                                          ##
  3. # # JBoss Bootstrap Script Configuration # #
  4. ##                                                                          ##
  5. ##############################################################################
  6. # # # $Id: run.conf 62747 2007-05- :43:36z Dimitris@jboss. org $
  7. #
  8. # this file is optional;  It is removed if not needed.
  9. #
  10. #
  11. # Specify the maximum file descriptor limit, use ' max ' or ' maximum ' to use
  12. # The default, as queried by the system.
  13. #
  14. # Defaults to "Maximum"
  15. #
  16. #MAX_FD ="Maximum"
  17. #
  18. # Specify the profiler configuration file to load.
  19. #
  20. # Default is to not load Profiler configuration file.
  21. #
  22. #PROFILER =""
  23. #
  24. # Specify the location of the Java home directory. If set then $JAVA would
  25. # is defined to $JAVA _home/bin/java, else $JAVA would be "JAVA".
  26. #
  27. #JAVA_HOME ="/opt/java/jdk"
  28. #set Java_home here; by DJQ
  29. Java_home="/jboss/jdk1.5.0_22"
  30. #
  31. # Specify the exact Java VM executable to use.
  32. #
  33. #JAVA =""
  34. #
  35. # Specify options to pass to the Java VM.
  36. #
  37. #If [ "x$java_opts" = "x"]; Then
  38. # java_opts="-xms128m-xmx512m-dsun.rmi.dgc.client.gcinterval=3600000-dsun.rmi.dgc.server.gcinterval=3600000 "  
  39. #fi
  40. # Set options for the JVM; by DJQ
  41. If [ "x$java_opts" = "x"]; Then
  42. java_opts="-xms1024m-xmx6120m-xx:permsize=128m-xx:maxpermsize=512m-xx:+heapdumponoutofmemoryerror- dsun.rmi.dgc.client.gcinterval=3600000-dsun.rmi.dgc.server.gcinterval=36000 "
  43. Fi
  44. # Sample JPDA settings for remote socket debuging
  45. #JAVA_OPTS ="$JAVA _opts-xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
  46. # Sample JPDA settings for shared memory debugging
  47. #JAVA_OPTS ="$JAVA _opts-xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"

Java VM parameter settings at JBoss startup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.