[英]what causes java minor gc
I am talking about UseParNewGC. 我说的是UseParNewGC。 My understanding of the java gc minor collection goes like this.
我对java gc minor集合的理解是这样的。 When, jvm detects that the eden is full (or it can't satify an allocation request)
何时,jvm检测到eden已满(或无法满足分配请求)
Is the exactly right? 完全正确吗? Is there a case when minor gc will be triggered even though eden is not full?
是否存在即使eden未满也会触发次要gc的情况?
I think you got the process right. 我认为您的流程正确。 There are situations where a major GC is triggered for reasons other than a full eden space, such as a call to
System.gc()
, or RMI. 在某些情况下,主要的GC可能是由于充满eden空间以外的原因而触发的,例如对
System.gc()
或RMI的调用。 In that case a minor GC will also be run. 在这种情况下,还将运行次要GC。
When, jvm detects that the eden is full (or it can't satify an allocation request) In a way, yes.
何时,jvm检测到eden已满(或者它无法满足分配请求)。 But it dynamically sizes the generation to meet certain goals of the collector.
但是它会动态调整生成的大小,以满足收集器的某些目标。 Mainly pause time and fraction of CPU time spent in the GC.
主要是暂停时间和GC中花费的CPU时间的一部分。
So indirectly these goals dictate how often minor collections happen. 因此,这些目标间接地决定了次要收藏的发生频率。 Major collections may also trigger a minor collection before they run to reduce references to old objects from short-lived young ones.
主要集合还可能触发次要集合,以减少对短暂生命的年轻对象的引用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.