directory

Nohup Java -jar xx.jar –xx=xx & Command to start the Springboot JAR

The sample

Java to.jar Settings

Heap Settings

Collector setup

Garbage collection statistics

Parallel collector setup

Concurrent collector setup

Take snapshots when exceptions occur

Jar sets the content in &

Port change mode

A typical setup

java -Xmx3550m -Xms3550m -Xmn2g -Xss128k


Nohup Java -jar xx.jar –xx=xx & Command to start the Springboot JAR

The sample

  • nohup java -Xms500m -Xmx500m -Xmn250m -Xss256k -server -XX:+HeapDumpOnOutOfMemoryError -jar /home/porject.jar --server.port=19281 --spring.profiles.active=dev  &
    Copy the code

     

Java to.jar Settings

Heap Settings

 

  • -Xms: indicates the initial heap size
  • -Xmx: indicates the maximum heap size
  • -xx :NewSize=n: Sets the size of the young generation
  • -xx :NewRatio=n: Sets the ratio of the young generation to the old generation. For example, is 3, indicating that the ratio of the young generation to the old generation is 1:3, and the young generation accounts for 1/4 of the sum of the young generation and the old generation
  • -xx :SurvivorRatio=n: ratio of Eden zone to two Survivor zones in a young generation. Notice that there are two Survivor zones. For example, 3 means Eden: Survivor= 3:2, and a Survivor zone accounts for 1/5 of the whole young generation
  • -xx :MaxPermSize=n: Set the persistent generation size

 

Collector setup

  • -xx :+UseSerialGC: Sets the serial collector
  • -xx :+UseParallelGC: Sets the parallel collector
  • -xx :+UseParalledlOldGC: sets the parallel generation collector
  • -xx :+UseConcMarkSweepGC: Sets the concurrent collector

 

Garbage collection statistics

  • -XX:+PrintGC
  • -XX:+PrintGCDetails
  • -XX:+PrintGCTimeStamps
  • -Xloggc:filename

 

Parallel collector setup

  • -xx :ParallelGCThreads=n: Sets the number of cpus used by the parallel collector for collection. Collect the number of threads in parallel.
  • -xx :MaxGCPauseMillis=n: Sets the maximum pause time for parallel collection
  • -xx :GCTimeRatio=n: Sets the percentage of garbage collection time in the running time of the program. Formula for 1 / (1 + n)

 

Concurrent collector setup

  • -xx :+CMSIncrementalMode: set it to incremental mode. This mode applies to a single CPU.
  • -xx :ParallelGCThreads=n: Sets the number of cpus used when the collection mode of the young generation of the concurrent collector is parallel collection. Collect the number of threads in parallel.

 

Take snapshots when exceptions occur

  •  -XX:+HeapDumpOnOutOfMemoryError

 

Jar sets the content in &

  • Yum can be configured in general projects
  • Xx =xx –xx. Xx =xx
  • Port =10101 or –spring.profiles. Active =dev startup type
  • There are also their own more customized project needs some offline connection database online connection database configuration

 

Port change mode

  • Nohup Java -jar/LSPT /servicev1.7/super_portal-1.0.jar –server.port=9999
  • Use – for server port = XXXX

 

A typical setup

java -Xmx3550m -Xms3550m -Xmn2g -Xss128k

 

  • -XMX3550m: Sets the maximum available memory of the JVM to 3550M.
  • -xMS3550m: Sets JVM to force memory to 3550m. This value can be set to the same as -xmx to avoid JVM memory reallocation after each garbage collection.
  • -Xmn2g: Set the size of the young generation to 2G. The total heap size = the size of the young generation + the size of the aged generation + the size of the persistent generation. The permanent generation has a fixed size of 64m, so increasing the young generation will reduce the size of the old generation. This value has a significant impact on system performance. Sun officially recommends setting it to 3/8 of the entire heap.
  • -xSS128K: Sets the stack size for each thread. After JDK5.0, the stack size of each thread is 1M. Before JDK5.0, the stack size of each thread is 256K. The size of memory required by more applied threads is adjusted. Reducing this value generates more threads for the same physical memory. However, the operating system has a limit on the number of threads in a process, which cannot be generated indefinitely. The experience value is about 3000~5000.

The implementation is as follows:

java -Xmx3550m -Xms3550m -Xss128k -XX:NewRatio=4 -XX:SurvivorRatio=4 -XX:MaxPermSize=16m -XX:MaxTenuringThreshold=0
Copy the code

 

 

 

 

Ok continues to update