我们有一个产生大量临时数据的java服务器应用程序,因此在GC中消耗了大量时间。我们正在尝试微调其JVM设置以获得最佳性能。目前我们的jvm设置如下:java -server -Xmx45700m -Xms34275m -XX:InitialTenuringThreshold=15 -XX:MaxTenuringThreshold=15 -XX:NewSize=32132m -XX:SurvivorRatio=4
JVM堆 - 为什么S0/S1的大小随着时间的推移而降低?
我们设置了较高的幸存者比率,以防止这个临时数据被移动到老一代区域。
我们看到的奇怪行为是随着时间的推移,S0/S1尺寸从5G的配置大小减小到小于1G。
这是从应用程序生命周期的开始: 堆
PSYoungGen total 27419648K, used 9887259K [0x00007ff819f80000, 0x00007ffff2380000, 0x00007ffff2380000)
eden space 21936128K, 44% used [0x00007ff819f80000,0x00007ffa6773e488,0x00007ffd54d80000)
from space 5483520K, 4% used [0x00007ffea3880000,0x00007ffeb18489f0,0x00007ffff2380000)
to space 5483520K, 0% used [0x00007ffd54d80000,0x00007ffd54d80000,0x00007ffea3880000)
ParOldGen total 2194432K, used 104K [0x00007ff4c9f80000, 0x00007ff54fe80000, 0x00007ff819f80000)
object space 2194432K, 0% used [0x00007ff4c9f80000,0x00007ff4c9f9a018,0x00007ff54fe80000)
PSPermGen total 37376K, used 37233K [0x00007ff4c4d80000, 0x00007ff4c7200000, 0x00007ff4c9f80000)
object space 37376K, 99% used [0x00007ff4c4d80000,0x00007ff4c71dc418,0x00007ff4c7200000)
And this is after some time:
Heap
PSYoungGen total 32397312K, used 4399893K [0x00007ff819f80000, 0x00007ffff2380000, 0x00007ffff2380000)
eden space 31891456K, 12% used [0x00007ff819f80000,0x00007ff907a4cbc0,0x00007fffb4780000)
from space 505856K, 99% used [0x00007fffb4780000,0x00007fffd35788b8,0x00007fffd3580000)
to space 505856K, 0% used [0x00007fffd3580000,0x00007fffd3580000,0x00007ffff2380000)
ParOldGen total 2194432K, used 774462K [0x00007ff4c9f80000, 0x00007ff54fe80000, 0x00007ff819f80000)
object space 2194432K, 35% used [0x00007ff4c9f80000,0x00007ff4f93cfa40,0x00007ff54fe80000)
PSPermGen total 45568K, used 45222K [0x00007ff4c4d80000, 0x00007ff4c7a00000, 0x00007ff4c9f80000)
object space 45568K, 99% used [0x00007ff4c4d80000,0x00007ff4c79a9900,0x00007ff4c7a00000)
为什么会减少从5G到0.5G?