runbroker.sh
#===========================================================================================# JVM Configuration# ===========================================================================================java_opt= "${JAVA_ OPT}-server-xms4g-xmx4g-xmn2g-xx:permsize=128m-xx:maxpermsize=320m "java_opt=" ${java_opt}-XX:+ useconcmarksweepgc-xx:+usecmscompactatfullcollection-xx:cmsinitiatingoccupancyfraction=70-xx:+ cmsparallelremarkenabled-xx:softreflrupolicymspermb=0-xx:+cmsclassunloadingenabled-xx:survivorratio=8-xx:+ DISABLEEXPLICITGC "java_opt=" ${java_opt}-verbose:gc-xloggc:${home}/rmq_bk_gc.log-xx:+printgcdetails-xx:+ Printgcdatestamps "java_opt=" ${java_opt}-xx:-O mitstacktraceinfastthrow "java_opt=" ${java_opt}-Djava.ext.dirs=${ Base_dir}/lib "#JAVA_OPT =" ${java_opt}-xdebug-xrunjdwp:transport=dt_socket,address=9555,server=y,suspend=n "JAVA_ Opt= "${java_opt}-CP ${classpath}"
-server By default, all client applications run In-client mode, while the directory server and certain server utilities run In-s erver mode. Generally,-server mode provides higher throughput than-client mode, at the expense of slightly longer startup times.
-xms4g Sets the initial size (in bytes) of the heap. This value must is a multiple of 1024x768 and greater than 1 MB. Append the letter K or K to indicate kilobytes, m or m to indicate megabytes, g or G to indicate gigabytes.
-xmx4g Specifies the maximum size (in bytes) of the memory allocation pool in bytes. This value must is a multiple of 1024x768 and greater than 2 MB. Append the letter K or K to indicate kilobytes, m or m to indicate megabytes, g or G to indicate gigabytes. The default value is chosen in runtime based on system configuration. For server deployments,-XMS And-xmx is often set to the same value. See the sections "Ergonomics" in Java SE HotSpot Virtual machine Garbage Collection Tuning Guide.
Click to see Configuring-the-default-jvm-and-java-arguments
-xmn2g Sets the initial and maximum size (in bytes) of the heap for the Young Generation (nursery). Append the letter K or K to indicate kilobytes, m or m to indicate megabytes, g or G to indicate gigabytes.
The young generation region of the heap is used for new objects. GC is performed in this region more often than in other regions. If the size for the young generation are too small, then a lot of minor garbage collections would be performed. If the size is too large and then only full garbage collections would be performed, which can take a long time to complete. Oracle recommends this keep the size for the young generation between a half and a quarter of the overall heap size. 7 8
-xx:permsize=128m Sets the space (in bytes) allocated to the permanent generation, triggers a garbage collection if it is exceeded. This option is deprecated UN JDK 8, and superseded by the-xx:metaspacesize option.
-xx:maxpermsize=320m Sets the maximum permanent generation space size (in bytes). This option is deprecated in JDK 8, and superseded by the-xx:maxmetaspacesize option.
-XX:+USECONCMARKSWEEPGC enables The use of the CMS garbage collector for the old generation. Oracle recommends that's the CMS garbage collector when application latency requirements cannot is met by the Throug Hput (-XX:+USEPARALLELGC) garbage collector. The G1 garbage collector (-XX:+USEG1GC) is another alternative. By default, this option is disabled and the collector are chosen automatically based on the configuration of the D type of the JVM. When this option was enabled, THE-XX:+USEPARNEWGC option was automatically set and you should not disable it, because the F ollowing combination of options have been deprecated in JDK 8:-XX:+USECONCMARKSWEEPGC-XX:-USEPARNEWGC.
-XX:+USEPARNEWGC Enables the use of parallel threads for collection in the young generation. By default, this option is disabled. It is automatically enabled when you set THE-XX:+USECONCMARKSWEEPGC option. Using THE-XX:+USEPARNEWGC option without THE-XX:+USECONCMARKSWEEPGC option is deprecated in JDK 8.
-xx:+usecmscompactatfullcollection means that compression is done after FGC because the CMS default does not compress the space.
-xx:cmsinitiatingoccupancyfraction=70 uses CMS as a garbage collection, using 70% to start CMS collections.
-xx:+cmsparallelremarkenabled turn on parallel tagging.
-xx:softreflrupolicymspermb=0 The surviving time of SoftReference in the free space per megabyte of heap. This flag enables aggressive processing of software references. Use this flag if the software reference count has a impact on the Java HotSpot VM garbage collector.
-xx:+cmsclassunloadingenabled Enables class unloading when using the concurrent Mark-sweep (CMS) garbage collector. This option is enabled by default. To disable class unloading for the CMS garbage collector, specify-xx:-cmsclassunloadingenabled.
-xx:survivorratio=8 Sets the ratio between Eden space size and survivor space size. By default, this option was set to 8. The following example shows how to set the Eden/survivor space ratio to 4:-xx:survivorratio=4
-XX:+DISABLEEXPLICITGC off System.GC ()
-VERBOSE:GC Displays information about each garbage collection (GC) event.
-xloggc:${home}/rmq_bk_gc.log Sets the file to which verbose GC events information should is redirected for logging. The information written to this file are similar to the output OF-VERBOSE:GC with the time elapsed since the first GC even t preceding each logged event. THE-XLOGGC option OVERRIDES-VERBOSE:GC If both is given with the same Java command.
-xx:+printgcdetails Enables printing of detailed messages at every GC. By default, this option is disabled.
-xx:+printgcdatestamps Enables printing of a date stamp at every GC. By default, this option is disabled.
ROCKETMQ runbroker.sh analyzing JVM Startup parameters