#programming
Java
→ Heap dump
→ Generate a Heap dump
→ On demand
The jcmd tool produce a binary heap dump
jcmd <pid> GC.heap_dump <file-path>
→ On crash
The below option does not add overhead, and using it in production is a good idea.
java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=<file-or-dir-path>
→ Analyse a thread dump
Eclipse Memory Annalyser allows to analyse the resulting dump files. this tutorial explains well how to use the tool.
→ Reading
- Building Microservices: Designing Fine-Grained Systems, Second Edition (O’Reilly Media, 2021)
- Microservices Patterns by Chris Richardson (Manning, 2018)
→ Running tests with maven and set log level
MAVEN_OPTS='-Dorg.slf4j.simpleLogger.defaultLogLevel=error' mvn test
→ Set maven version
mvn versions:set -DgroupId=* -DartifactId=* -DnewVersion=0.13.0 -DgenerateBackupPoms=false
→ java concepts
- A Java virtual machine (JVM) is an abstract machine. It is a specification that provides a runtime environment in which Java bytecode can be executed.
- The Java Runtime Environment (JRE) is used to provide a runtime environment. It is the implementation of the JVM that physically exists. It contains a set of libraries and other files that the JVM uses at runtime. Oracle bought Sun Microsystems in 2010; since then, new versions and patches have been actively provided. Other companies, such as IBM, provide their own implementations of the JVM.
- The Java Development Kit (JDK) contains the JRE, documentation, and Java tools. This is what Java developers install on their machines. A smart editor like IntelliJ IDEA or Eclipse will require you to provide the location of the JDK so classes and documentation can be loaded and used during development.
→ jmx
- Java Management Extensions (JMX) framework
- jmx tutorial
- visualVM is a jdk tool to explore jmx metrics of the application running in the respective jvm
→ Dates
→ Get logs as json
This page was last modified: