PS幸存者空间几乎已满 [英] PS Survivor space almost full

查看:235
本文介绍了PS幸存者空间几乎已满的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,大多数时间里PS幸存者空间几乎已满(98%).我不知道PS幸存者空间是什么.这正常吗? 在这种情况下应该怎么做?

I see the the PS survivor space is almost full (98 %) most of the time for my application. I don't know what is PS survivor space . Is this normal ? What should be done in such scenarios ?

推荐答案

首先,请参见例如此处:什么是幸存空间?

First, see e.g. here : What is a survivor space?

通常,堆的YoungGeneration部分有2个幸存者空间(例如,对于Hostpot VM).它们在那里可以让对象成熟,然后再将其升级为老一代.因为清理旧一代的成本更高.

Usually, there are 2 survivor spaces in the YoungGeneration part of the heap (e.g. for the Hostpot VM ). They are there to allow objects to mature before promoting them to the Old Generation. Because its more expensive to cleanup the old generation.

收集一些统计信息,以了解幸存者空间在大多数情况下是否确实已满.您应该看到一个始终为空,而另一个正在填充.参见例如收集GC统计信息的问题.

Collect some statistics to see if the survivor spaces are really full most of the time. You should see that one is always empty while the other one is being populated. See e.g. this question for collecting GC stats.

一旦有了数据,请查找:

Once you have the data, look for:

  • 幸存者空间溢出-当幸存者空间太小而无法允许对象在YoungHeap集合之间成熟并且对象溢出到OldGeneration而又没有时间成熟时(以及没被提升就死了.

  • survivor space overflow - this occurs when the survivor space is too small to allow the objects to mature between YoungHeap collections and the objects are overflowing to the OldGeneration without having time to mature (and die before being promoted).

还用-XX:+PrintTenuringDistribution监视历年分布.看看物体成熟的速度有多快.

also, monitor tenuring distribution with -XX:+PrintTenuringDistribution. To see how fast are the objects maturing.

更新:阅读

UPDATE: Read the Hotspot Memory Management Whitepaper and see the section Serial Collector, there is a nice explanations of the Survivor spaces:

注意:如果 To 空间已满,则来自 Eden From 的活动对象尚未 复制到其中的文件都是使用期限的文件,而不管它们存活了多少年轻一代收藏.任何 根据定义,在复制活动对象之后,保留在 Eden 发件人空间中的对象不是活动对象,因此不需要检查.

Note: If the To space becomes full, the live objects from Eden or From that have not been copied to it are tenured, regardless of how many young generation collections they have survived. Any objects remaining in Eden or the From space after live objects have been copied are, by definition, not live, and they do not need to be examined.

这篇关于PS幸存者空间几乎已满的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆