4,563,404 th visitor since 2017.2.1 ( Today : 298 )
Programming
No. 734
Name. swindler
Subject. java.lang.OutOfMemoryError: PermGen space
Main Cate. Java
Sub Cate.
Date. 2013-11-28 17:22
Hit. 5260 (211.36.27.3)
File.
관련글 : http://coolx.net/cboard/develop/334


근데 PermGen size를 알아낼 수는 없는것 같다.

전체적인 메모리 사용량은 다음과 같이 알아낼 수 있다.

Max Memory : <%=Runtime.getRuntime().maxMemory()/1000%> KB
<br/>
Total Memory : <%=Runtime.getRuntime().totalMemory()/1000%> KB
<br/>
Free Memory : <%=Runtime.getRuntime().freeMemory()/1000%> KB
<br/>
Used Memory : <%=(Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory())/1000%> KB
<br/>


jinfo 라는 별도의 툴을 이용하여 알아낼 수 있는듯.

jinfo -flag PermSize pid


아래와 같은 출력이 나타난다.


Heap
PSYoungGen total 30528K, used 22536K [0x00000007d70b0000, 0x00000007da500000, 0x0000000800000000)
eden space 25344K, 68% used [0x00000007d70b0000,0x00000007d81a4680,0x00000007d8970000)
from space 5184K, 99% used [0x00000007d9490000,0x00000007d999dab8,0x00000007d99a0000)
to space 11392K, 0% used [0x00000007d8970000,0x00000007d8970000,0x00000007d9490000)
PSOldGen total 83840K, used 11279K [0x0000000785200000, 0x000000078a3e0000, 0x00000007d70b0000)
object space 83840K, 13% used [0x0000000785200000,0x0000000785d03ec0,0x000000078a3e0000)
PSPermGen total 33856K, used 33731K [0x000000077ac00000, 0x000000077cd10000, 0x0000000785200000)
object space 33856K, 99% used [0x000000077ac00000,0x000000077ccf0cb8,0x000000077cd10000)



각각에 대한 자세한 내용은 아직 파악을 하지 못했는데.

java 실행옵션에 PermSize, MaxPermSize 를 다음과 같이 지정한 후에는
-XX:PermSize=128m -XX:MaxPermSize=256m


Heap
PSYoungGen total 76480K, used 26980K [0x00000000eaab0000, 0x00000000f0000000, 0x0000000100000000)
eden space 65600K, 30% used [0x00000000eaab0000,0x00000000ebdf6148,0x00000000eeac0000)
from space 10880K, 66% used [0x00000000eeac0000,0x00000000ef1d3070,0x00000000ef560000)
to space 10880K, 0% used [0x00000000ef560000,0x00000000ef560000,0x00000000f0000000)
PSOldGen total 174784K, used 1725K [0x00000000c0000000, 0x00000000caab0000, 0x00000000eaab0000)
object space 174784K, 0% used [0x00000000c0000000,0x00000000c01af6b8,0x00000000caab0000)
PSPermGen total 131072K, used 32071K [0x00000000b0000000, 0x00000000b8000000, 0x00000000c0000000)
object space 131072K, 24% used [0x00000000b0000000,0x00000000b1f51f48,0x00000000b8000000)


대략적으로 보면 설정전에 비하여 total이 많이 증가하여 used 비율이 낮아졌음을 알 수 있다.

각 항목에 대해서는 다음에 좀더 알아봐야겠다.

[바로가기 링크] : http://coolx.net/cboard/develop/734



swindler tomcat에서 update, reload가 발생할때 메모리반환을 제대로 하지 않기 때문에 hot deploy를 안 걸면 괜찮다는 말도 있다. enablePooling을 false로 해도 된다는데, 아무래도 성능저하가 좀 있는듯. 2013-11-28
Name
Password
Comment
Copyright © 1999-2017, swindler. All rights reserved. 367,611 visitor ( 1999.1.8-2004.5.26 ), 2,405,771 ( -2017.01.31)

  2HLAB   2HLAB_Blog   RedToolBox   Omil   Omil_Blog