java printgc_在java 9中处理PrintGCApplicationStoppedTime标志

在那里很少有人知道:

首先,@ apangin的答案here很好地总结了 PrintGCApplicationStoppedTime 打印了在safepoints内花费的时间 .

为了将更多细节转储到您的应用程序的安全点,您应该更好地利用:

-XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1

继续使用哪个 -Xlog 将用作新的命令行选项来控制来自JVM的所有组件的日志记录 . 因此,日志记录将遵循语法(引用):

-Xlog[:option]

option := [][:[][:[][:]]]

'help'

'disable'

what := [,...]

selector := [*][=]

tag-set := [+...]

'all'

tag := name of tag

level := trace

debug

info

warning

error

output := 'stderr'

'stdout'

[file=]

decorators := [,...]

'none'

decorator := time

uptime

timemillis

uptimemillis

timenanos

uptimenanos

pid

tid

level

tags

output-options := [,...]

output-option := filecount=

filesize=

parameter=value

选择几个不同的例子来学习:

-Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1024

使用'trace'标记'gc'标记的日志消息到一个旋转文件集,其中包含5个文件,大小为1MB,基本名称为'gctrace.txt',并使用decorations 'uptimemillis'和'pid'

级别'warning'到'stderr'的所有消息的默认输出仍然有效

-Xlog:gc+rt+compiler*=debug,meta*=warning,svc*=off

日志消息至少用'gc'和'rt'以及'compiler'标记使用'trace'级别标记为'stdout',但仅记录标记为'meta'且级别为'warning'或'error'的消息,并关闭所有标记为'svc'的消息

级别'warning'到'stderr'的所有消息的默认输出仍然有效

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值