Java不停机上线_java---不停机控制jvm的gc选项

背景

很久之前的事情了,在很久很久……

一般在做性能测试的时候为最小限度影响性能,基本会不开gc日志,但出现问题,有要查看相关信息,麻勒个烦啊

有没有两全其美的办法?

废话略过,往下看

jinfo

jinfo(Java Configuration Information),主要用于查看正在运行的Java进程(或核心文件、远程调试服务器)的Java配置信息

用法

[root@localhost config]# jinfo

Usage:

jinfo [option]

(to connect to running process)

jinfo [option]

(to connect to a core file)

jinfo [option] [server_id@]

(to connect to remote debug server)

where is one of:

-flag to print the value of the named VM flag

-flag [+|-] to enable or disable the named VM flag

-flag = to set the named VM flag to the given value

-flags to print VM flags

-sysprops to print Java system properties

to print both of the above

-h | -help to print this help message

重点看-flag选项(圈起来要考试~)

在使用-flag选项时,jinfo实用程序可以动态调整特定Java进程的特定Java VM标志的值。这类选项的列表是有限的,但在一些场合仍然有用。JVM上的这些标志的完整列表可以通过以下命令进行检查

[root@localhost config]# java -XX:+PrintFlagsFinal -version|grep manageable

intx CMSAbortablePrecleanWaitMillis = 100 {manageable}

intx CMSTriggerInterval = -1 {manageable}

intx CMSWaitDuration = 2000 {manageable}

bool HeapDumpAfterFullGC = false {manageable}

bool HeapDumpBeforeFullGC = false {manageable}

bool HeapDumpOnOutOfMemoryError = false {manageable}

ccstr HeapDumpPath = {manageable}

uintx MaxHeapFreeRatio = 100 {manageable}

uintx MinHeapFreeRatio = 0 {manageable}

bool PrintClassHistogram = false {manageable}

bool PrintClassHistogramAfterFullGC = false {manageable}

bool PrintClassHistogramBeforeFullGC = false {manag

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值