确保在Java中调用GC [英] Ensuring the call to GC in Java
本文介绍了确保在Java中调用GC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何确保在使用System.gc()时是否在java中调用垃圾收集器?
How to ensure whether or not the garbage collector is called in java when we are using System.gc() ?
推荐答案
参见 http://docs.oracle.com/javase/7/docs/api/java/ lang / System.html#gc() [ ^ ]。但是,虚拟机仍然决定是立即运行还是将请求排队。一般来说,你不应该担心它。
See http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#gc()[^]. However it is still the virtual machine's decision as to whether it runs immediately or queues the request. In general you should not be concerned about it.
这篇关于确保在Java中调用GC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文