How to Detect Memory Leaks in Java* +: Tips and Tricks

First thing: LOGS

JVM generates can generate 3 types of logs, to help you optimise the performance.

  1. GC log
  2. Thread Dump
  3. Heap Dump

Check GC algorithm

With Java 11+, G1 algorithm is the default one. For java8+ version, this new algorithm needs to be enabled explicitly.

Useful tools:

  • JConsole –
  • JFR
    Be aware that not all java versions 8+ are compatible with it.
  • – 5 Free Analysis/Month | No Credit Card Required – and it requires account
  • – this can be run on docker using the following command
    docker run -d -p 80:80 gcplot/gcplot
  • JVisualVM

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.