Skip to content

Instantly share code, notes, and snippets.

@schnell18
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schnell18/225d8ddc3006204a67b4 to your computer and use it in GitHub Desktop.
Save schnell18/225d8ddc3006204a67b4 to your computer and use it in GitHub Desktop.
Random Java Performance Tuning scripts
# make a thread dump
ps -ef |grep <your_java_process_cmd>
jstack <your_java_process_PID> > java_thread_dump.txt
# print Oracle Hotspot JVM effective flags
java -XX:PrintFlagsFinal > effective_flags.txt 2>/dev/null
# dump all Oracle Hotspot JVM effective flags for running Java Proccess
jcmd <mail_class|PID> VM.flags -all
# list non-default Oracle Hotspot JVM flags for running Java Proccess
jcmd <mail_class|PID> VM.flags -all | grep ":="
# trigger full GC for running Java Process
jcmd <mail_class|PID> GC.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment