测量在JVM上花费在GC上的时间 [英] Measuring time spent on GC in JVM

查看:145
本文介绍了测量在JVM上花费在GC上的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我正在测试一个Java服务器应用程序。我知道完成测试需要多少时间。现在我想知道在测试期间在GC上花了多少钱。我该怎么做?最简单的方法是使用 -Xloggc 和<$

在启动JVM时,c $ c> -XX:-PrintGCTimeStamps
选项。我认为它会显示垃圾收集需要多长时间。



http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html


Suppose I am testing a Java server application. I know how much time it takes to finish the test. Now I'd like to know how much was spent on GC during that test. How can I do it?

解决方案

The simplest way is to use the -Xloggc and -XX:-PrintGCTimeStamps options when starting up your JVM. I think it prints out how long garbage collection takes.

http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

这篇关于测量在JVM上花费在GC上的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆