为什么在执行完GC之后,永久生成的分配大小会增加? [英] Why does allocated size of permanent generation increase after executing perform GC?

查看:181
本文介绍了为什么在执行完GC之后,永久生成的分配大小会增加?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我从jvisualvm执行执行GC 后执行的快照。




第一张图片是Heap stats,第二张图片是perm gen stats。我无法理解,当我使用GC 堆大小减少(如预期),但永久代的分配大小增加(尽管所使用的permgen大小保持不变)



使用的JVM参数

  -Xbootclasspath / p:../ xyz.jar 
-Xbootclasspath / a:../ abc.jar
-Djava.endorsed.dirs = .. / resolver
-Djava.library.path = .. / framework
-Djavax.management.builder.initial = JBeanServerBuilder
-Djavax.net.ssl.trustStore = .. / certs
-Dorg.mortbay.log.class = JettyLogger
-Xms128m
-Xmx256m
-Xdebug
-Xnoagent
-Xrunjdwp:transport = dt_socket,server = y,suspend = y,address = 2000

注意:我更改了名称(ex xyz.jar)原因。

JVm信息:

  JVM:Java HotSpot(TM) )64位服务器虚拟机(23.6-b04,混合模式)
Java:版本1.7.0_11,供应商Oracle Corporation
Java Home:/home/aniket/jdk1.7.0_11/jre
JVM标志:< none>


解决方案


  • 内存分配堆/ Perm / Eden / Young / S1 / S2等空间取决于用于GC的基础算法。

  • 以上空格的内存分配没有被定义为绝对值参数。它们被定义为可用于JVM的总堆/ perm的比率。

  • 以上两点可能指出,当堆大小发生变化时,所有空间的所有内存分配都会重新计算,以维持定义的比率。


以下链接将非常有用:



http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html a>


Following are the snapshots I took after executing perform GC from jvisualvm. and

First image is Heap stats and 2nd one is perm gen stats. I am not able to understand when I did GC utilized heap size decreased(as expected) but the allocated size of permanent generation increased (though the utilized permgen size remained the same).What could be the possible explanation of such behavior?

JVM arguments used

-Xbootclasspath/p:../xyz.jar
-Xbootclasspath/a:../abc.jar
-Djava.endorsed.dirs=../resolver
-Djava.library.path=../framework
-Djavax.management.builder.initial=JBeanServerBuilder
-Djavax.net.ssl.trustStore=../certs
-Dorg.mortbay.log.class=JettyLogger
-Xms128m
-Xmx256m
-Xdebug
-Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=2000

Note : I have changed the name(ex xyz.jar) for propriety reasons.

JVm Info:

JVM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04, mixed mode)
Java: version 1.7.0_11, vendor Oracle Corporation
Java Home: /home/aniket/jdk1.7.0_11/jre
JVM Flags: <none>

解决方案

  • The memory-allocation Heap/Perm/Eden/Young/S1/S2 etc spaces depends on the underlying algorithm used for GC.
  • Memory allocation to above spaces are not defined as absolute values parameters. They are defined as ratios to total heap / perm available to JVM.
  • Above two points probably point out that when Heap size changes, all memory allocations to all spaces are re-evaluated to maintain the ratio which are defined.

Below link will be really useful:

http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html

这篇关于为什么在执行完GC之后,永久生成的分配大小会增加?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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