Java Garbage Collection Monitoring and Analysis

In this Java garbage collection tutorial series let us look about the tools available for garbage collection monitoring and analysis. Then use a tool and monitor an example Java application for garbage collection process. If you are a beginner it is better for you to go through this series of tutorials. You can start with introduction for Java garbage collection.

Java Garbage collection monitoring and analysis tools

Following are some of the tools available. Each of these following tools have their own advantages and disadvantages. We can improve performance of an application by choosing the right tool and doing the analysis in an organized manner. For this tutorial, let us go with the Java VisualVM.

  • Java VisualVM
  • Naarad
  • GCViewer
  • IBM Pattern Modeling and Analysis Tool for Java Garbage Collector
  • HPjmeter
  • IBM Monitoring and Diagnostic Tools for Java – Garbage Collection and Memory
  • Visualizer
  • Verbose GC Analyzer

Java VisualVM

Java VisualVM is available with the Java SE SDK installation for free. Just have a look at the bin folder of your Java JDK installation. \Java\jdk1.8.0\bin is the path. There are many other tools available along with the javac and java tools. jvisualvm is one among them.

Java VisualVM provides information about running Java applications with a visual interface. It is many tool bundled into one. Tools like JConsole, jstat, jinfo, jstack, and jmap are now part of Java VisualVM.

Java VisualVM can be used to

  • generate and analyze heap memory dumps
  • view and operate on MBeans
  • monitor garbage collection
  • memory and CPU profiling

1. Launch VisualVM

jvisualvm is available in bin fold of JDK.

Start Java VisualVM

Java VisualVM

2. Install Visual GC Plugin

We need to install a visual GC plugin have a nice and worthy visual feel of the Java GC process.

Visual GC Plugin

3. Monitor GC

Now its time to monitor the garbage collection process. Start your Java application and it will be auto detected and shown in the Java VisualVM interface. In the left side “Applications” pane under the “Local” node, all the locally running Java applications will be listed.

Java VisualVM is a Java application and so it will also me listed in it. For tutorial purpose we will monitory the GC process for the VisualVM application itself.

Double click the VisualVM icon shown below the “Local” node.

GC Analysis

Now the application monitoring pane is open on the right side. There are different tabs to show each of the performance related monitoring aspects of the application. As of now our interest is on “Visual GC” and lets click it.

Heap Memory Space Allocation

Above image show the memory spaces utilization for Old, Eden, S0 and S1 spaces. Following graphs shows each segment wise detail allocation and de-allocation of memory space. It keeps updating at defined refresh rate.

GC Graphs

The above shown graphs are for a normally behaving application. When there is a memory leak or any abnormal behaviour it will explicitly evident from the graph itself. To the least we can understand that there is an issue related to object memory allocation and garbage collection. Then with the help of other tabs like “Threads” and with Thread Dump we can narrow down the issue.

In the “Monitor” tab we can monitor overall Heap memory utilization as a timer series graph. We have got “Perform GC” button to initiate the garbage collection process.

Perform GC

In the “Sampler” tab we can start the memory and CPU profiling process. It will show detailed live report for each instance wise utilization. It will help to nail down the performance problem.

Instances Memory Allocation

With this tutorial, we have come to the end of the four part Java garbage collection tutorial series.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值