Is there a GC in Java that does not introduce late

2019-04-25 11:00发布

Just curious. I heard something about the new G1GC addressing that latency problem. I can't / don't want to use RTSJ.

Thanks in advance

4条回答
我只想做你的唯一
2楼-- · 2019-04-25 11:36

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.

查看更多
小情绪 Triste *
3楼-- · 2019-04-25 11:47

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.

查看更多
ゆ 、 Hurt°
4楼-- · 2019-04-25 11:52

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

enter image description here

(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.

查看更多
【Aperson】
5楼-- · 2019-04-25 11:54

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

查看更多
登录 后发表回答