notes on ibm:dw"5 things you didn't know about ... Command-line flags for the JVM"

本文介绍两个重要的JVM标志:DisableExplicitGC用于将System.gc()调用转换为无操作,帮助评估其对JVM性能的影响;HeapDumpOnOutOfMemoryError则允许在发生内存溢出错误时捕获堆快照。
摘要由CSDN通过智能技术生成


article original address:http://www.ibm.com/developerworks/java/library/j-5things11/index.html



DisableExplicitGC flag

Explicit garbage collection is a really bad idea -- sometimes on the order of locking youreself in a phone booth with a rabid pit bull.


System.gc()forces the VM to do a full sweeper of the heap, even if one isn't necessary. Full sweeps are typically serveral orders of magnitude more.


The +DisableExplicitGC flag automatically turns a System.gcc() call into a no-op, giving you the opportunity to run your code and see for yourself whether System.gc() has helped or harmed the overall execution of JVM.



HeapDumpOnOutOfMemoryError

The +HeapDumpOnOutOfMemoryError flag let VM catch a snapshot of heap right as the VM on its dying breath.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值