0% found this document useful (0 votes)
4 views2 pages

Java Command Usage and Memory Settings

The document contains various Java commands for managing memory settings, checking heap size, and monitoring Java applications. It includes examples of JVM options for memory configuration, garbage collection logging, and usage of tools like jps and jmap for process management. Additionally, it references external resources for further reading on Java memory usage and Spring Boot asynchronous controllers.

Uploaded by

primeashif
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Java Command Usage and Memory Settings

The document contains various Java commands for managing memory settings, checking heap size, and monitoring Java applications. It includes examples of JVM options for memory configuration, garbage collection logging, and usage of tools like jps and jmap for process management. Additionally, it references external resources for further reading on Java memory usage and Spring Boot asynchronous controllers.

Uploaded by

primeashif
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

java -XshowSettings:properties -version

java -XX:+PrintFlagsFinal -version | grep HeapSize


java -XX:+PrintFlagsFinal {periodicScreening} | grep HeapSize
java -XX:+PrintFlagsFinal -version | findstr /i "HeapSize PermSize ThreadStackSize"
java -XX:+PrintFlagsFinal -Xms512m -Xmx1024m -Xss512k -XX:PermSize=64m -
XX:MaxPermSize=128m
-version | grep -iE 'HeapSize|PermSize|ThreadStackSize'

jdbc:mysql://xxxx/xxx?serverTimezone=Asia/
Shanghai&useUnicode=true&characterEncoding=UTF-
8&useSSL=false&allowPublicKeyRetrieval=true

java -Xms373m -Xmx1024m -Xmn140m -XX:PermSize=5m -XX:MaxPermSize=5m -


Xmaxf0.2 -Xminf0.1

-server -Xms8g -Xmx8g -XX:+UseG1GC -XX:MaxGCPauseMillis=500 -


XX:InitiatingHeapOccupancyPercent=50 -XX:+UseCompressedOops
-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps
-Xloggc:/path/to/log/directory/[Link]
java -jar -Xms373m -Xmx1024m -Xmn140m -XX:PermSize=5m -XX:MaxPermSize=5m -
Xmaxf0.2 -Xminf0.1 [Link]

jps -lvm
jps
ps auwx|egrep "MEM|34336"|grep -v grep
ps auwx|egrep "MEM|2304"|grep -v grep
pmap -x 43369
jmap -histo -F 43369 |more
[Link]
[Link]

memory command of java


[Link]
ps -o pid,user,%mem,command ax | sort -b -k3 -r

nohup java -jar [Link] > nohup.$(date --iso).out

[Link]
[Link]
[Link]

nohup command >/dev/null 2>&1 &

-XX:+PrintCompalition
-XX:+PrintCodeCache
java --XX:+PrintStringTableStatistics --XX:StringTableSize

In Linux:

java -XX:+PrintFlagsFinal -version | grep ThreadStackSize

In Windows:

java -XX:+PrintFlagsFinal -version | findstr ThreadStackSize


Unix/Linux system, you can do
java -XX:+PrintFlagsFinal -version | grep HeapSize

On Windows, use the following command to find out the defaults

java -XX:+PrintFlagsFinal -version | findstr HeapSize


java -Xmx32m -Xss256k -jar target/[Link]
[Link]-threads: 4

1. Make it executable : chmod +x sis_service.sh


2. run this executable file : sudo ./sis_service.sh

You might also like