简体   繁体   English

一代的大小影响垃圾收集中其他一代的吞吐量

[英]Sizing of a generation affects throughput of other generation in garbage collection

How the impacting of resizing of a generation size (say younger generation) affect the collection frequency and pause times of other generations (say tenured generation)? 一代人(例如年轻一代)调整大小的影响如何影响其他几代人的收集频率和暂停时间(比如终身代)?

In this article https://www.oracle.com/technetwork/java/gc-tuning-5-138395.html , it is approximated to no effect. 在本文https://www.oracle.com/technetwork/java/gc-tuning-5-138395.html中 ,它近似无效。 I want to understand the reason behind this approximation. 我想了解这种近似背后的原因。

What you need to consider here is that the primary factors that control GC pause times are the rate of object allocation and how quickly those objects become garbage. 您需要考虑的是控制GC暂停时间的主要因素是对象分配速率以及这些对象变为垃圾的速度。

It's also important to understand that (in Hotspot) young and old generations use different algorithms. 同样重要的是要理解(在Hotspot中)年轻一代和老一代使用不同的算法。

For the young generation, collection is simply copying objects to a survivor space or tenuring into the old generation. 对于年轻一代来说,收藏只是将物品复制到幸存者空间或者延伸到老一代。 How big the old gen. 老一代有多大。 is will only have an impact if there isn't enough space to promote all the necessary objects. 只有在没有足够的空间来宣传所有必要的对象时才会产生影响。

For the old gen., there are different algorithms but they all need to identify live data and usable space. 对于旧版本,有不同的算法,但它们都需要识别实时数据和可用空间。 Changing the size of the young generation will affect how frequently a minor GC happens but not how much data ultimately ends up in the old gen. 改变年轻一代的规模将影响次要GC发生的频率,但不会影响最终数据最终会在旧版本中发生。 Depending on the algorithm used, it may be necessary to perform a full compacting collection but, again, when this happens will not be affected by the size of the young gen. 根据所使用的算法,可能需要执行完全压缩收集,但是,当这种情况发生时,不会受到年轻人的大小的影响。 The rate of tenuring and fragmentation of the old gen. 老一代的终身和分裂率。 will be the deciding factors. 将是决定因素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM