Java GC Monitoring With JVisualVM [Video]
Learn best practices for maintaining your garbage collection and heap in Java, with tips for keeping your app tidy and prevent you from running out of memory.
Join the DZone community and get the full member experience.Join For Free
Java garbage collection is a very critical aspect of JVM runtime, and poorly performing GC can have adverse impacts on the performance of your java application.
In this presentation, we will take a deep dive into what GC is all about, what the JVM heap looks like, and how objects are moved from one area of the heap to another. We will use JVisualVM, a very useful tool for debugging java performance problems.
We will also have a demo where one sample application will be used to demonstrate how the heap and GC behave in a typical application. We will simulate two scenarios: first, where the application will keep allocating objects in memory. We will show how the heap comes under pressure over time and GC starts kicking in too frequently, which can impact the performance of the application.
In the second scenario, we will show how following best practices of objects referencing/un-referencing can save you from getting problems like OutOfMemory or too many GC cycles etc.
Opinions expressed by DZone contributors are their own.