SUN JDK 1.4.2, 1.5 GC Option

Java 2009. 1. 30. 11:44



Sun GC option (build 1.4.2_18-b06 에서 Test, JDK 1.5 동일)
   -Xms64m                      : 최소 heap size
   -Xmx256m                    : 최대 heap size
   -XX:PermSize=64m        : 최소 perm size
   -XX:MaxPermSize=64m  : 최대 perm size
  
   -verbose:gc                              : gc log 출력
   -Xloggc:./gclog.log                  : gc log file 기록
   -XX:+PrintGCDetails                 : 상세출력
   -XX:+PrintGCTimeStamps        : timestamp 출력
   -XX:+PrintHeapAtGC                 : gc한 상태의 heap 영역 출력   
   -XX:+PrintTenuringDistribution : Print tenuring age information
   -XX:+ShowMessageBoxOnError  : JVM crach 발생시 메세지 박스 출력(Sun에선 공식설명 없으나 동작함.)
  EX) -XX:+ShowMessageBoxOnError  
  ==============================================================================
  Unexpected Error
  ------------------------------------------------------------------------------
  SIGSEGV (0xb) at pc=0xb7fc0402, pid=17842, tid=3085269200
  
  Do you want to debug the problem?
  
  To debug, run 'gdb /proc/17842/exe 17842'; then switch to thread -1209698096
  Enter 'yes' to launch gdb automatically (PATH must include gdb)
  Otherwise, press RETURN to abort...
  ==============================================================================




GC Log Example
EX) -verbose:gc -Xloggc:./gclog.log
 16.479: [GC 3976K->1363K(65088K), 0.0347330 secs]
 17.525: [GC 5203K->3923K(65088K), 0.0574820 secs]
 21.643: [GC 57684K->55123K(65088K), 0.0018090 secs]
 21.645: [Full GC 55123K->20563K(65088K), 0.0441540 secs]
 21.748: [GC 41043K->41043K(65152K), 0.0019690 secs]
 21.751: [Full GC 41043K->41043K(65152K), 0.0147680 secs]

EX) -verbose:gc -Xloggc:./gclog.log -XX:+PrintGCDetails
 16.412: [GC 16.413: [DefNew: 3976K->83K(4544K), 0.0305770 secs] 3976K->1363K(65088K), 0.0310270 secs]
 17.453: [GC 17.454: [DefNew: 3923K->83K(4544K), 0.0495660 secs] 5203K->3923K(65088K), 0.0497540 secs]
 21.399: [GC 21.399: [DefNew: 2644K->83K(4544K), 0.0023250 secs]21.402: [Tenured: 55040K->20563K(60544K), 0.0451070 secs] 57684K->20563K(65088K), 0.0482600 secs]
 21.508: [GC 21.508: [DefNew: 0K->0K(4608K), 0.0018920 secs]21.510: [Tenured: 41043K->41043K(60544K), 0.0150950 secs] 41043K->41043K(65152K), 0.0178590 secs]
 22.827: [GC 22.827: [DefNew: 0K->0K(5184K), 0.0021710 secs]22.830: [Tenured: 82003K->41043K(109372K), 0.0770740 secs] 82003K->41043K(114556K), 0.0800650 secs]
 23.029: [GC 23.030: [DefNew: 0K->0K(8256K), 0.0027250 secs]23.033: [Tenured: 82003K->82003K(109372K), 0.0708040 secs] 82003K->82003K(117628K), 0.0756220 secs]
 24.841: [GC 24.842: [DefNew: 0K->0K(10368K), 0.0035190 secs]24.845: [Tenured: 163923K->82003K(218596K), 0.1448700 secs] 163923K->82003K(228964K), 0.1502950 secs]
 25.239: [GC 25.240: [DefNew: 0K->0K(16448K), 0.0030840 secs]25.243: [Tenured: 163923K->163923K(218596K), 0.0186830 secs] 163923K->163923K(235044K), 0.0246090 secs]
 25.264: [Full GC 25.264: [Tenured: 163923K->163922K(241984K), 0.2243630 secs] 163923K->163922K(260160K), [Perm : 983K->983K(65536K)], 0.2252740 secs]

EX) -verbose:gc -Xloggc:./gclog.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
 16.426: [GC 16.434: [DefNew: 3976K->83K(4544K), 0.1745330 secs] 3976K->1363K(65088K), 0.1757260 secs]
 17.625: [GC 17.626: [DefNew: 3923K->83K(4544K), 0.1504880 secs] 5203K->3923K(65088K), 0.1515850 secs]
 21.638: [GC 21.639: [DefNew: 2644K->83K(4544K), 0.0023950 secs]21.641: [Tenured: 55040K->20563K(60544K), 0.0454170 secs] 57684K->20563K(65088K), 0.0485820 secs]
 21.745: [GC 21.746: [DefNew: 0K->0K(4608K), 0.0017730 secs]21.748: [Tenured: 41043K->41043K(60544K), 0.0139250 secs] 41043K->41043K(65152K), 0.0167400 secs]
 23.052: [GC 23.052: [DefNew: 0K->0K(5184K), 0.0021500 secs]23.054: [Tenured: 82003K->41043K(109372K), 0.0748140 secs] 82003K->41043K(114556K), 0.0792520 secs]
 23.249: [GC 23.250: [DefNew: 0K->0K(8256K), 0.0019270 secs]23.253: [Tenured: 82003K->82003K(109372K), 0.0691750 secs] 82003K->82003K(117628K), 0.0740190 secs]
 25.046: [GC 25.047: [DefNew: 0K->0K(10368K), 0.0041480 secs]25.051: [Tenured: 163923K->82003K(218596K), 0.1416940 secs] 163923K->82003K(228964K), 0.1472180 secs]
 25.439: [GC 25.440: [DefNew: 0K->0K(16448K), 0.0035490 secs]25.443: [Tenured: 163923K->163923K(218596K), 0.0185150 secs] 163923K->163923K(235044K), 0.0244940 secs]
 25.464: [Full GC 25.464: [Tenured: 163923K->163922K(241984K), 0.2279020 secs] 163923K->163922K(260160K), [Perm : 983K->983K(65536K)], 0.2289560 secs]

EX) -verbose:gc -Xloggc:./gclog.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC
 25.217: [GC  {Heap before GC invocations=7:
 Heap
  def new generation   total 16448K, used 0K [0x9f720000, 0xa08f0000, 0xa0ad0000)
   eden space 14656K,   0% used [0x9f720000, 0x9f720000, 0xa0570000)
   from space 1792K,   0% used [0xa0570000, 0xa0570000, 0xa0730000)
   to   space 1792K,   0% used [0xa0730000, 0xa0730000, 0xa08f0000)
  tenured generation   total 218596K, used 163923K [0xa0ad0000, 0xae049000, 0xaf720000)
    the space 218596K,  74% used [0xa0ad0000, 0xaaae4c70, 0xaaae4e00, 0xae049000)
  compacting perm gen  total 65536K, used 983K [0xaf720000, 0xb3720000, 0xb3720000)
    the space 65536K,   1% used [0xaf720000, 0xaf815c78, 0xaf815e00, 0xb3720000)
 25.217: [DefNew: 0K->0K(16448K), 0.0035860 secs]25.221: [Tenured: 163923K->163923K(218596K), 0.0202250 secs] 163923K->163923K(235044K) Heap after GC invocations=8:
 Heap
  def new generation   total 18176K, used 0K [0x9f720000, 0xa0ad0000, 0xa0ad0000)
   eden space 16192K,   0% used [0x9f720000, 0x9f720000, 0xa06f0000)
   from space 1984K,   0% used [0xa06f0000, 0xa06f0000, 0xa08e0000)
   to   space 1984K,   0% used [0xa08e0000, 0xa08e0000, 0xa0ad0000)
  tenured generation   total 241984K, used 163923K [0xa0ad0000, 0xaf720000, 0xaf720000)
    the space 241984K,  67% used [0xa0ad0000, 0xaaae4c70, 0xaaae4e00, 0xaf720000)
  compacting perm gen  total 65536K, used 983K [0xaf720000, 0xb3720000, 0xb3720000)
    the space 65536K,   1% used [0xaf720000, 0xaf815c78, 0xaf815e00, 0xb3720000)
 } , 0.0260100 secs]
 25.243: [Full GC  {Heap before GC invocations=8:
 Heap
  def new generation   total 18176K, used 0K [0x9f720000, 0xa0ad0000, 0xa0ad0000)
   eden space 16192K,   0% used [0x9f720000, 0x9f720000, 0xa06f0000)
   from space 1984K,   0% used [0xa06f0000, 0xa06f0000, 0xa08e0000)
   to   space 1984K,   0% used [0xa08e0000, 0xa08e0000, 0xa0ad0000)
  tenured generation   total 241984K, used 163923K [0xa0ad0000, 0xaf720000, 0xaf720000)
    the space 241984K,  67% used [0xa0ad0000, 0xaaae4c70, 0xaaae4e00, 0xaf720000)
  compacting perm gen  total 65536K, used 983K [0xaf720000, 0xb3720000, 0xb3720000)
    the space 65536K,   1% used [0xaf720000, 0xaf815c78, 0xaf815e00, 0xb3720000)
 25.243: [Tenured: 163923K->163922K(241984K), 0.2528490 secs] 163923K->163922K(260160K), [Perm : 983K->983K(65536K)] Heap after GC invocations=9:
 Heap
  def new generation   total 18176K, used 0K [0x9f720000, 0xa0ad0000, 0xa0ad0000)
   eden space 16192K,   0% used [0x9f720000, 0x9f720000, 0xa06f0000)
   from space 1984K,   0% used [0xa06f0000, 0xa06f0000, 0xa08e0000)
   to   space 1984K,   0% used [0xa08e0000, 0xa08e0000, 0xa0ad0000)
  tenured generation   total 241984K, used 163922K [0xa0ad0000, 0xaf720000, 0xaf720000)
    the space 241984K,  67% used [0xa0ad0000, 0xaaae4b00, 0xaaae4c00, 0xaf720000)
  compacting perm gen  total 65536K, used 983K [0xaf720000, 0xb3720000, 0xb3720000)
    the space 65536K,   1% used [0xaf720000, 0xaf815c78, 0xaf815e00, 0xb3720000)
 } , 0.2534500 secs]


EX) -verbose:gc -Xloggc:./gclog.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution
22.899: [DefNew
Desired survivor size 229376 bytes, new threshold 31 (max 31)
- age   1:         96 bytes,         96 total
- age   3:      84976 bytes,      85072 total

: 2644K->83K(4544K), 0.0020960 secs]22.901: [Tenured: 55040K->20563K(60544K), 0.0450150 secs] 57684K->20563K(65088K) Heap after GC invocations=3:
Heap
 def new generation   total 4608K, used 0K [0x9f7a0000, 0x9fc90000, 0xa0b50000)
  eden space 4160K,   0% used [0x9f7a0000, 0x9f7a0000, 0x9fbb0000)
  from space 448K,   0% used [0x9fbb0000, 0x9fbb0000, 0x9fc20000)
  to   space 448K,   0% used [0x9fc20000, 0x9fc20000, 0x9fc90000)
 tenured generation   total 60544K, used 20563K [0xa0b50000, 0xa4670000, 0xaf7a0000)
   the space 60544K,  33% used [0xa0b50000, 0xa1f64c60, 0xa1f64e00, 0xa4670000)
 compacting perm gen  total 65536K, used 983K [0xaf7a0000, 0xb37a0000, 0xb37a0000)
   the space 65536K,   1% used [0xaf7a0000, 0xaf895e08, 0xaf896000, 0xb37a0000)
} , 0.0480610 secs]
23.005: [GC  {Heap before GC invocations=3:
Heap
 def new generation   total 4608K, used 0K [0x9f7a0000, 0x9fc90000, 0xa0b50000)
  eden space 4160K,   0% used [0x9f7a0000, 0x9f7a0000, 0x9fbb0000)
  from space 448K,   0% used [0x9fbb0000, 0x9fbb0000, 0x9fc20000)
  to   space 448K,   0% used [0x9fc20000, 0x9fc20000, 0x9fc90000)
 tenured generation   total 60544K, used 41043K [0xa0b50000, 0xa4670000, 0xaf7a0000)
   the space 60544K,  67% used [0xa0b50000, 0xa3364c70, 0xa3364e00, 0xa4670000)
 compacting perm gen  total 65536K, used 983K [0xaf7a0000, 0xb37a0000, 0xb37a0000)
   the space 65536K,   1% used [0xaf7a0000, 0xaf895e08, 0xaf896000, 0xb37a0000)
23.005: [DefNew
Desired survivor size 229376 bytes, new threshold 31 (max 31)
: 0K->0K(4608K), 0.0018680 secs]23.007: [Tenured: 41043K->41043K(60544K), 0.0155750 secs] 41043K->41043K(65152K) Heap after GC invocations=4:
Heap
 def new generation   total 5184K, used 0K [0x9f7a0000, 0x9fd40000, 0xa0b50000)
  eden space 4608K,   0% used [0x9f7a0000, 0x9f7a0000, 0x9fc20000)
  from space 576K,   0% used [0x9fc20000, 0x9fc20000, 0x9fcb0000)
  to   space 576K,   0% used [0x9fcb0000, 0x9fcb0000, 0x9fd40000)
 tenured generation   total 68408K, used 41043K [0xa0b50000, 0xa4e1e000, 0xaf7a0000)
   the space 68408K,  59% used [0xa0b50000, 0xa3364c70, 0xa3364e00, 0xa4e1e000)
 compacting perm gen  total 65536K, used 983K [0xaf7a0000, 0xb37a0000, 0xb37a0000)
   the space 65536K,   1% used [0xaf7a0000, 0xaf895e08, 0xaf896000, 0xb37a0000)
} , 0.0188350 secs]


1.5는 좀더 자세함. - Perm gen의 shared-ro와 shared-rw 이해안감.
# Perm Gen [shared-ro]: read-only reflective data
# Perm Gen [shared-rw]: read-write reflective data

28.735: [GC {Heap before gc invocations=13:
 def new generation   total 16448K, used 0K [0x7c9b0000, 0x7db80000, 0x7dd60000)
  eden space 14656K,   0% used [0x7c9b0000, 0x7c9b0000, 0x7d800000)
  from space 1792K,   0% used [0x7d9c0000, 0x7d9c0000, 0x7db80000)
  to   space 1792K,   0% used [0x7d800000, 0x7d800000, 0x7d9c0000)
 tenured generation   total 218632K, used 163942K [0x7dd60000, 0x8b2e2000, 0x8c9b0000)
   the space 218632K,  74% used [0x7dd60000, 0x87d79b40, 0x87d79c00, 0x8b2e2000)
 compacting perm gen  total 65536K, used 22K [0x8c9b0000, 0x909b0000, 0x909b0000)
   the space 65536K,   0% used [0x8c9b0000, 0x8c9b59b0, 0x8c9b5a00, 0x909b0000)
    ro space 8192K,  68% used [0x909b0000, 0x90f33660, 0x90f33800, 0x911b0000)
    rw space 12288K,  48% used [0x911b0000, 0x91782408, 0x91782600, 0x91db0000)
28.735: [DefNew
Desired survivor size 917504 bytes, new threshold 15 (max 15)
: 0K->0K(16448K), 0.0042840 secs]28.741: [Tenured: 163942K->163942K(218632K), 0.0196940 secs] 163942K->163942K(235080K)Heap after gc invocations=14:
 def new generation   total 18176K, used 0K [0x7c9b0000, 0x7dd60000, 0x7dd60000)
  eden space 16192K,   0% used [0x7c9b0000, 0x7c9b0000, 0x7d980000)
  from space 1984K,   0% used [0x7d980000, 0x7d980000, 0x7db70000)
  to   space 1984K,   0% used [0x7db70000, 0x7db70000, 0x7dd60000)
 tenured generation   total 241984K, used 163942K [0x7dd60000, 0x8c9b0000, 0x8c9b0000)
   the space 241984K,  67% used [0x7dd60000, 0x87d79b40, 0x87d79c00, 0x8c9b0000)
 compacting perm gen  total 65536K, used 22K [0x8c9b0000, 0x909b0000, 0x909b0000)
   the space 65536K,   0% used [0x8c9b0000, 0x8c9b59b0, 0x8c9b5a00, 0x909b0000)
    ro space 8192K,  68% used [0x909b0000, 0x90f33660, 0x90f33800, 0x911b0000)
    rw space 12288K,  48% used [0x911b0000, 0x91782408, 0x91782600, 0x91db0000)
}
, 0.0289380 secs]
28.764: [Full GC {Heap before gc invocations=14:
 def new generation   total 18176K, used 0K [0x7c9b0000, 0x7dd60000, 0x7dd60000)
  eden space 16192K,   0% used [0x7c9b0000, 0x7c9b0000, 0x7d980000)
  from space 1984K,   0% used [0x7d980000, 0x7d980000, 0x7db70000)
  to   space 1984K,   0% used [0x7db70000, 0x7db70000, 0x7dd60000)
 tenured generation   total 241984K, used 163942K [0x7dd60000, 0x8c9b0000, 0x8c9b0000)
   the space 241984K,  67% used [0x7dd60000, 0x87d79b40, 0x87d79c00, 0x8c9b0000)
 compacting perm gen  total 65536K, used 22K [0x8c9b0000, 0x909b0000, 0x909b0000)
   the space 65536K,   0% used [0x8c9b0000, 0x8c9b59b0, 0x8c9b5a00, 0x909b0000)
    ro space 8192K,  68% used [0x909b0000, 0x90f33660, 0x90f33800, 0x911b0000)
    rw space 12288K,  48% used [0x911b0000, 0x91782408, 0x91782600, 0x91db0000)
28.764: [Tenured: 163942K->163941K(241984K), 0.2293520 secs] 163942K->163941K(260160K), [Perm : 22K->21K(65536K)]Heap after gc invocations=15:
 def new generation   total 18176K, used 0K [0x7c9b0000, 0x7dd60000, 0x7dd60000)
  eden space 16192K,   0% used [0x7c9b0000, 0x7c9b0000, 0x7d980000)
  from space 1984K,   0% used [0x7d980000, 0x7d980000, 0x7db70000)
  to   space 1984K,   0% used [0x7db70000, 0x7db70000, 0x7dd60000)
 tenured generation   total 241984K, used 163941K [0x7dd60000, 0x8c9b0000, 0x8c9b0000)
   the space 241984K,  67% used [0x7dd60000, 0x87d79498, 0x87d79600, 0x8c9b0000)
 compacting perm gen  total 65536K, used 21K [0x8c9b0000, 0x909b0000, 0x909b0000)
   the space 65536K,   0% used [0x8c9b0000, 0x8c9b57d0, 0x8c9b5800, 0x909b0000)
    ro space 8192K,  68% used [0x909b0000, 0x90f33660, 0x90f33800, 0x911b0000)
    rw space 12288K,  48% used [0x911b0000, 0x91782408, 0x91782600, 0x91db0000)





Sun homepage의 예제
    -verbose:gc
      [GC 325407K->83000K(776768K), 0.2300771 secs]
      [GC 325816K->83372K(776768K), 0.2454258 secs]
      [Full GC 267628K->83769K(776768K), 1.8479984 secs]
     
    -verbose:gc -XX:+PrintGCDetails
      [GC [DefNew: 64575K->959K(64576K), 0.0457646 secs] 196016K->133633K(261184K), 0.0459067 secs]]
   
    -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
        111.042: [GC 111.042: [DefNew: 8128K->8128K(8128K), 0.0000505 secs]111.042: [Tenured: 18154K->2311K(24576K), 0.1290354 secs] 26282K->2311K(32704K), 0.1293306 secs]








GC OUTPUT SAMPLE - Diagnosing a Garbage Collection problem
    : http://java.sun.com/docs/hotspot/gc1.4.2/example.html

FAQ - Frequently Asked Questions about Garbage Collection in the HotspotTM JavaTM Virtual Machine
    : http://java.sun.com/docs/hotspot/gc1.4.2/faq.html

       

'Java' 카테고리의 다른 글

SimpleDateFormat -> FastDateFormat  (1) 2009.06.29
용어 설명  (0) 2009.02.23
jconsole test - (sun jdk 1.5)  (0) 2009.02.23
SUN JDK 1.4.2 Heap dump Option  (0) 2009.01.30
JVM 기타  (0) 2009.01.30
Sun JVM Monitoring  (0) 2009.01.30
JVM spec  (0) 2009.01.30
SUN JDK 1.4.2 GC 정책  (0) 2009.01.29