PS Survivour空间几乎已满 [英] PS Survivour space almost full

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

问题描述

我看到我的应用程序大部分时间的PS存储空间几乎已满(98%)。我不知道什么是PS幸存者空间。这是正常的吗?
在这种情况下应该做什么?
有人可以解释。
在此先感谢:) 首先,请参阅这里:什么是幸存者空间?



通常情况下,在堆的YoungGeneration部分中有2个幸存者空间(例如,用于Hostpot VM)。在将它们推广到老一代之前,他们在那里允许物体成熟。因为它清理旧一代的成本更高。

收集一些统计数据,看大多数时间幸存者空间是否真的充满。你应该看到,其中一个总是空的而另一个正在填充。见例如这个问题的收集GC统计信息



一旦您拥有数据,寻找:


  • 幸存者空间溢出 - 当幸存者空间太小以允许对象在YoungHeap集合之间成熟并且对象溢出到OldGeneration而没有时间成熟(并且在被提升之前死亡)。

  • 另外,使用 -XX:+ PrintTenuringDistribution 监控持久分发。查看对象成熟的速度。

  • 阅读热点内存管理白皮书并参见 Serial Collector ,对Survivor空间有一个很好的解释:
    $ b


    注意:如果 To 空间已满,来自 Eden 的尚未复制到
    的活动对象为终身,无论他们存活了多少年代的收藏品。根据定义,在活动对象被复制之后,在 Eden 空间中剩余的任何
    对象都不是活的,并且不需要检查它们。



    I see the the PS surviour space is almost full (98 %) most of the time for my application. I dont know what is PS survivor space . Is this normal ? What should be done in such scenarios ? Can someone please explain . Thanks in advance :)

    解决方案

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

    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.

    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:

    • 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).

    • 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:

    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 Survivour空间几乎已满的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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