问题描述
是这样的: https://groups.google.com/forum/? fromgroups#!topic/golang-dev/Ab1sFeoZg_8 :
如果JVM用户长期苦苦挣扎,GC暂停次数就会很高.
High GC pauses are one if the things JVM users struggle with for a long time.
什么是(体系结构上的)约束?这些约束阻止JVM将GC暂停降低到Go级别,但不影响Go?
What are the (architectural?) constraints which prevent JVM from lowering GC pauses to Go levels, but are not affecting Go?
推荐答案
没有.
稍作搜索就可以发现类似的解决方案也适用于Java
A little googling shows that similar solutions are available for java too
- Azul提供了可扩展的无暂停收集器甚至达到100GB +
- Redhat正在为openjdk和oracle shenandoah .openjdk.java.net/display/zgc/Main"rel =" noreferrer> zgc .
- IBM提供了节拍器,其目标还在于微秒的暂停时间
- 其他各种实时JVM
- Azul offers a pauseless collector that scales even to 100GB+
- Redhat is contributing shenandoah to openjdk and oracle zgc.
- IBM offers metronome, also aiming for microsecond pause times
- various other realtime JVMs
与Go的不同,openjdk中的其他收集器是压缩世代收集器.这是为了避免碎片问题,并通过启用凹凸指针分配并减少在GC中花费的CPU时间,在具有大堆的服务器级计算机上提供更高的吞吐量.至少在良好的条件下,尽管CMS与移动的年轻代收集器配对,也可以实现单位毫秒的暂停.
The other collectors in openjdk are, unlike Go's, compacting generational collectors. That is to avoid fragmentation problems and to provide higher throughput on server-class machines with large heaps by enabling bump pointer allocation and reducing the CPU time spent in GC. And at least under good conditions CMS can achieve single-digit millisecond pauses, despite being paired with a moving young-generation collector.
Go的收集器是非世代的,非紧凑的,并且需要写障碍(请参阅此),这将导致吞吐量降低/集合的CPU开销增加,内存占用量(碎片)增加以及对象在堆上的缓存有效放置效率降低(非紧凑型内存布局).
Go's collector is non-generational, non-compacting and requires write barriers (see this other SO question), which results in lower throughput/more CPU overhead for collections, higher memory footprint (fragmentation) and less cache-efficient placement of objects on the heap (non-compact memory layout).
这篇关于为什么Go可以将GC暂停降低到1ms以下,而JVM却没有呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!