Is there a GC in Java that does not introduce latency (stop-the-world) by perhaps running 100% concurrently?

不羁岁月 提交于 2019-12-05 05:50:45

I don't think there are any zero-pause garbage collectors. But generally speaking a low-pause collector like CMS will do the job.

The problems with pauses and pause reduction are as follows:

  • A zero-pause (or almost zero-pause) collection regime significantly increases overheads for normal program execution. This is particularly true with multithreaded languages like Java.

  • Schemes that use a dedicated thread or threads to do garbage collection can get swamped if the application generates too much garbage.

  • Any GC scheme will give you poor performance if the application's memory usage patterns are too "lumpy" and/or you don't have enough physical and virtual memory.

You might be interested in something like the Zing JVM.

Azul systems have put a lot of effort into low-latency JVM tuning. I believe there are also some interesting technical papers that explain how this is done.

Matt Ball

It sounds like you're looking for the CMS GC — concurrent mark sweep.

(source: https://java.sun.com/j2se/reference/whitepapers/memorymanagement_whitepaper.pdf, p.12)


December 2015 update: you might be interested in Azul's "pauseless" GC. See Explanation of Azul's "pauseless" garbage collector for more.

You can try the latest G1 Garbage collection in JDK 7.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!