Skip to content

Instantly share code, notes, and snippets.

@jgeek
Last active January 13, 2016 14:58
Show Gist options
  • Save jgeek/68b4690ee7c7c9ec960b to your computer and use it in GitHub Desktop.
Save jgeek/68b4690ee7c7c9ec960b to your computer and use it in GitHub Desktop.
Java Commands
heap dump:
jmap -dump:format=b,file=heap.bin <pid>
thread dump:
jstack -l JAVA_PID > jstack.out
-----------------
# java links:
https://www.reucon.com/cdn/java/
http://ghaffarian.net/downloads/Java/JDK/
-----------------------
# Generate javadoc from package
# javadoc -d <output_folder> -sourcepath <folder path which java packages are in it> -subpackages <package_name>
$ javadoc -d ~/tempfiles/javadoc -sourcepath java -subpackages ir
# enabling/disabling assertion:
-enableassertions or -ea
-disableassertions or -da
# enabling / disabling assertion for package, class
$ java -ea:com.wombat.fruitbat -da:com.wombat.fruitbat.Brickbat BatTutor
# assetion for system classes:
-enablesystemassertions, or -esa
-disablesystemassertions, or -dsa
# jvm parameters
thread stack size: -Xss512k (default is 1024k)
-Xms1024m
-Xmx1024m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment