PSYoungGen /PSOldGen/PSPermGen區別


原文地址:http://bbs.csdn.net/topics/210064791

誰能解譯一下PSYoungGen /PSOldGen/PSPermGen區別及出現的問題?

看來沒有收集到答案,查看了很多書,終於是知道了.

在這里提供給大家學習學習,同時自己也鞏固一下!

SUN JVM GC 使用是分代收集算法,即將內存分為幾個區域,將不同生命周期的對象放在不同區域里.
新的對象會先生成在Young area,也就是PSYoungGen中
在幾次GC以后,如過沒有收集到,就會逐漸升級到PSOldGen 及Tenured area(也就是PSPermGen)中。

三者區別:
在GC收集的時候,頻繁收集生命周期短的區域(Young area),因為這個區域內的對象生命周期比較短,GC 效率也會比較高。而比較少的收集生命周期比較長的區域(Old area or Tenured area),以及基本不收集的永久區(Perm area)。

示例:

Event: 31.128 GC heap before
{Heap before GC invocations=11 (full 0):
 PSYoungGen      total 28928K, used 25856K [0x00000000ef560000, 0x00000000f18b0000, 0x0000000100000000)
  eden space 22336K, 100% used [0x00000000ef560000,0x00000000f0b30000,0x00000000f0b30000)
  from space 6592K, 53% used [0x00000000f1240000,0x00000000f15b0000,0x00000000f18b0000)
  to   space 6912K, 0% used [0x00000000f0b30000,0x00000000f0b30000,0x00000000f11f0000)
 ParOldGen       total 68288K, used 14219K [0x00000000ce000000, 0x00000000d22b0000, 0x00000000ef560000)
  object space 68288K, 20% used [0x00000000ce000000,0x00000000cede2f78,0x00000000d22b0000)
 PSPermGen       total 21248K, used 9290K [0x00000000c8e00000, 0x00000000ca2c0000, 0x00000000ce000000)
  object space 21248K, 43% used [0x00000000c8e00000,0x00000000c97129e0,0x00000000ca2c0000)
Event: 31.136 GC heap after
Heap after GC invocations=11 (full 0):
 PSYoungGen      total 24256K, used 2400K [0x00000000ef560000, 0x00000000f18d0000, 0x0000000100000000)
  eden space 21824K, 0% used [0x00000000ef560000,0x00000000ef560000,0x00000000f0ab0000)
  from space 2432K, 98% used [0x00000000f0b30000,0x00000000f0d88000,0x00000000f0d90000)
  to   space 7232K, 0% used [0x00000000f11c0000,0x00000000f11c0000,0x00000000f18d0000)
 ParOldGen       total 68288K, used 16467K [0x00000000ce000000, 0x00000000d22b0000, 0x00000000ef560000)
  object space 68288K, 24% used [0x00000000ce000000,0x00000000cf014f78,0x00000000d22b0000)
 PSPermGen       total 21248K, used 9290K [0x00000000c8e00000, 0x00000000ca2c0000, 0x00000000ce000000)
  object space 21248K, 43% used [0x00000000c8e00000,0x00000000c97129e0,0x00000000ca2c0000)
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM