Tag Archives: gc

Java Memory Management in Practice: Video Notes

This post contains the notes that accompany the video tutorial JMM in Practice on YouTube. On this video you can learn the basic principles of how the JVM performs garbage collection and manages the heap space.

Download the Source Code

You can download the source code from this GitHub repository.
It is a Maven project that you can directly import into your favourite IDE.

Installing and Running Visual VM

The Visual VM download page is located here.

To install Visual VM you just need to unzip the downloaded archive into a directory of your choice.

To run Visual VM invoke the binary for your operating system, passing the options for the JDK and user directory (this is the location where you want Visual VM to store data files).

For example, on Windows:

visualvm.exe --jdkhome <path to JDK> --userdir <path to user directory>

 

Once Visual VM is running you can activate the Visual GC plugin as follows:

1. From the menu select Tools -> Plugins
2. In the popup window select the tab “Available Plugins”
3. Check “Visual GC” from the list and click on the Install button
4. Close the popup

You should see the “Visual GC” tab now available on Visual VM.

Watch the Video

You now have all the tools you need to follow the video and replicate the experiment on your system.