BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡

±Û¾´ÀÌ: asdas [ÀÀ´ä]gc Àå¾ÖÁø´Ü Á¶È¸¼ö: 13051



gc´ÔÀÇ ±Û
------------------------------------
Xms1024m -Xmx1024m -XX:MaxPermSize=256m // Xms ¿Í Xmx ÀÇ Â÷ÀÌ´Â virtual ¸Þ¸ð¸®ÀÓ.
-XX:NewSize=100m -XX:MaxNewSize=100m -XX:SurvivorRatio=32 // young generationÀ» À§ÇÑ ¿É¼Ç
-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSParallelRemarkEnabled // gc ½Ã°£À» ÃÖ¼ÒÈ­
-XX:-DisableExplicitGC // System.gc() ¸¦ disable ÇÑ´Ù.
-XX:MaxTenuringThreshold=0 -XX:CMSInitiatingOccupancyFraction=60 // ¼º´ÉÀ» À§ÇÑ ±âŸ Ãß°¡ ¿É¼Ç
-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails // gc print ¿É¼Ç

[GC ¼³¸í]

GC ´Â minor gc(young generation) ¿Í major gc (tenured generation) ·Î ±¸ºÐµÈ´Ù.
minor gc ´Â ·Î±×¿¡ [GC] ·Î Ç¥½ÃµÇ¸ç major gc ´Â [Full GC]·Î Ç¥½ÃµÈ´Ù.


JVM ¿µ¿ª


young generation ÀÌ Å¬¼ö·Ï minor gc ´Â Àû°Ô ÀϾ´Ù. ±×·¯³ª heap »çÀÌÁîÀÇ ¿µ¿ª¿¡¼­ young generation ÀÌ Å©´Ù´Â °ÍÀº
»ó´ëÀûÀ¸·Î tenured generation ÀÛ´Ù´Â °ÍÀ» ÀǹÌÇϹǷΠmajor gc °¡ ÀÚÁÖ ÀϾ°Ô µÈ´Ù.
young generation Àº NewRatio °ªÀ¸·Î Á¦¾îÇÒ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î -XX:NewRatio=3 ¿É¼ÇÀº young:tenured °¡ 1:3 ÀÇ ºñÀ²À»
À¯ÁöÇÑ´Ù´Â °ÍÀ» ÀǹÌÇÑ´Ù.
young generation Àº NewSize¿Í MaxNewSize·Î ÁöÁ¤ÇÒ ¼ö Àִµ¥ µÎ ÇÕÀ» °°ÀÌÇϸé Xms, Mmx ¸¦ ÇÕÇÑ°ÍÀ» »ç¿ëÇϵíÀÌ
young generation ÀÇ Å©±â¸¦ Á¤ÇÒ ¼ö ÀÖ´Ù.

young generationÀº eden ¿µ¿ª°ú first survivor, second survivor ¿µ¿ªÀ¸·Î ±¸¼ºµÈ´Ù. ÀÌ»óÀûÀÎ minor gc´Â eden°ú first survivor¿¡
ÀúÀåµÇ¾î »ç¿ëÁßÀÎ °´Ã¼°¡ second survivor·Î º¹»çµÇ´Â °ÍÀÌ´Ù. ±×·¯³ª second survivor ¿µ¿ªÀÌ ÃæºÐÇÏ´Ù°í º¸ÀåµÇÁö´Â ¾Ê´Â´Ù.
±×·¯¹Ç·Î minor gc ¸¦ ¼º°øÇϱâ À§Çؼ­ tenured generation¿¡ ¿Àµç °´Ã¼°¡ ÀúÀåµÉ ¼ö ÀÖ´Â ÃæºÐÇÑ ¸Þ¸ð¸®°¡ È®º¸µÇ¾î¾ß ÇÑ´Ù.
¸¸¾à tenured generation ¿µ¿ª°ú eden + survivor ¿µ¿ªÀÇ »ç¿ëÁßÀÎ °´Ã¼ ¸Þ¸ð¸®°¡ °°´Ù¸é ´õÀÌ»ó minor gc ·Î tenured generation ¿µ¿ªÀ»
»ç¿ëÇÒ ¼ö ¾øÀ¸¹Ç·Î major gc°¡ ¹ß»ýÇÏ°Ô µÈ´Ù.

SurvivorRatio ÆĶó¹ÌÅ͸¦ »ç¿ëÇϸé survivor ¿µ¿ªÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î -XX:SurvivorRatio=6 À̶ó°í ÇÑ´Ù¸é
°¢ survivor ¿µ¿ª°ú eden ÀÇ ¿µ¿ªÀÌ 1:6 À̶ó´Â ÀǹÌÀÌ´Ù. ±×·¯¹Ç·Î ÇϳªÀÇ survivor ´Â ÃÑ young generation ¿µ¿ª¿¡¼­ 1/8 ÀÌ µÈ´Ù.
(second °¡ ÀÖÀ¸¹Ç·Î 1/7 ÀÌ ¾Æ´Ï¶ó 1/8 ÀÌ µÈ´Ù.)


[4°¡Áö type ÀÇ collector]

1. default garbage collector

2. The throughput collector

-XX:+UseParallelGC ¸¦ »ç¿ëÇÏ´Â ¹æ¹ý

3. The concurrent low pause collector

CPU °¡ 2ÀåÀÌ»ó ¸¹À¸¸é ¸¹À»¼ö·Ï Àû¿ëÇϱâ ÀûÇÕÇÑ collector ÀÌ´Ù.
concurrent low pause collector ´Â ¿î¿µÁßÀÎ ¼­¹ö¿¡ gc·Î ÀÎÇÑ pause ¸¦ ÃÖ¼ÒÈ­ Çϱâ À§Çؼ­ »ç¿ëµÇ´Â ¿É¼ÇÀÌ´Ù.
tenured generation µµ ÇÔ²² ÀϾ´Ù.
ÀÌ ¿É¼ÇÀ» Àû¿ëÇÒ·Á¸é -XX:+UseParNewGC -XX:+UseConcMarkSweepGC µÎ°¡Áö ¿É¼ÇÀ» ÁÖ¸é µÈ´Ù.
±×·¯³ª -XX:+UseParallelGC ¿É¼Ç°ú -XX:+UseParNewGC ¿É¼ÇÀ» µ¿½Ã¿¡ »ç¿ëÇÏ¸é ¾ÈµÈ´Ù.

4. The incremental (sometimes called train) low pause collector

ÀϺκÐÀº tenured generation ÀÌ ÀϾ¸ç major gc ÀÇ ÀϽøØÃãÇö»óÀ» ÃÖ¼ÒÈ­ ÇÒ ¼ö ÀÖ´Ù.
±×·¯³ª throughput À» °í·ÁÇÒ ¶§ default collector º¸´Ù ´À¸®´Ù.
-Xincgc ¿É¼ÇÀ» »ç¿ëÇÏ¸é µÇ³ª ´Ù¸¥ ¿É¼Ç°ú ÇÔ²² »ç¿ëÇϸé JVMÀÌ ¾î¶»°Ô µ¿ÀÛÇÒÁö ¿¹»óÇÒ ¼ö ¾øÀ¸¹Ç·Î
°°ÀÌ »ç¿ëÇÏ¸é ¾ÈµÈ´Ù.


[GC log format]

[GC [: -> , secs] -> , secs]

is an internal name for the collector used in the minor collection
is the occupancy of the young generation before the collection
is the occupancy of the young generation after the collection
is the pause time in seconds for the minor collection.
is the occupancy of the entire heap before the collection
is the occupancy of the entire heap after the collection
is the pause time for the entire garbage collection. This would include the time for a major collection is one was done.

[ GC log case Çؼ® ]

1. Young generation size is too small

[GC [DefNew: 4032K->64K(4032K), 0.0429742 secs] 9350K->7748K(32704K), 0.0431096 secs]

-> gc °¡ Àß µÈ°Í °°À¸³ª 9350K->7748K ·Î ÁÙ¾îµé¾úÀ¸´Ï ÃÑ ÁÙ¾îµç °æ¿ì°¡ 1602K Á¤µµ ¹Û¿¡ µÇÁö ¾Ê´Â´Ù.
Àüü ¸Þ¸ð¸®Áß¿¡¼­ 40% ´Â ¿©ÀüÈ÷ »ç¿ëµÇ°í ÀÖÀ¸´Ï ÀÌ´Â young generation ÀÌ ³Ê¹« ÀÛ´Ù´Â À̾߱âÀÌ´Ù.

2. The young generation size is too large

[GC [DefNew: 16000K->16000K(16192K), 0.0000574 secs][Tenured: 2973K->2704K(16384K), 0.1012650 secs] 18973K->2704K(32576K), 0.1015066 secs]

-> ¾ÕºÎºÐ¿¡ º¸¸é 16000K->16000K·Î º¯ÇÔÀÌ ¾ø´Ù. ¿Ö³ÄÇϸé À̸¦ º¹»çÇÒ Tenured °¡ »ó´ëÀûÀ¸·Î ÀûÀ¸´Ï º¯ÇÔÀÌ ¾ø´Â °ÍÀÌ´Ù.
ÀÌ °æ¿ì´Â young generation ÁÙ¾îµé·Á¸é major gc °¡ ÀϾ¾ß ÁÙ¾îµé ¼ö ÀÖ´Ù.
±×·¡µµ ¿É¼Ç¿¡ ÀÇÇؼ­ Tenured ¿µ¿ª¿¡ ÀϺΠgc°¡ ÀϾ 18973K->2704K(32576K) ¸¸Å­ ÁÙ¾îµç °á°ú¸¦ º¸ÀÌ°í ÀÖ´Ù.

3. Is the tenured generation too large or too small?

[GC [DefNew: 8128K->8128K(8128K), 0.0000558 secs][Tenured: 17746K->2309K(24576K), 0.1247669 secs] 25874K->2309K(32704K), 0.1250098 secs]

-> ÃÑ ¸Þ¸ð¸®°¡ 32M ÀÏ °æ¿ì major gc °¡ ÀϾ ¾à 0.13ÃÊ°¡ °É·È´Ù.

[GC [DefNew: 8128K->8128K(8128K), 0.0000369 secs][Tenured: 50059K->5338K(57344K), 0.2218912 secs] 58187K->5338K(65472K), 0.2221317 secs]

-> ÃÑ ¸Þ¸ð¸®°¡ 64M ÀÏ °æ¿ì major gc °¡ ÀϾ ¾à 0.23ÃÊ°¡ °É·È´Ù.

À§ÀÇ µÑÀ» ºñ±³ÇØ º¼ ¶§ ù¹ø°°¡ ÁÁÀ» °Í °°À¸³ª ÀÌ´Â gc ÀÇ ºó¹øµµ¸¦ ¾Ë¾ÆºÁ¾ß ÃÖÁ¾ °á·ÐÀ» ³¾ ¼ö ÀÖ´Ù.

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]
122.463: [GC 122.463: [DefNew: 8128K->8128K(8128K), 0.0000560 secs]122.463: [Tenured: 18630K->2366K(24576K), 0.1322560 secs] 26758K->2366K(32704K), 0.1325284 secs]
133.896: [GC 133.897: [DefNew: 8128K->8128K(8128K), 0.0000443 secs]133.897: [Tenured: 18240K->2573K(24576K), 0.1340199 secs] 26368K->2573K(32704K), 0.1343218 secs]

-> ù¹ø°´Â 11Ãʸ¶´Ù ÀϾ ¹Ý¸é¿¡

90.597: [GC 90.597: [DefNew: 8128K->8128K(8128K), 0.0000542 secs]90.597: [Tenured: 49841K->5141K(57344K), 0.2129882 secs] 57969K->5141K(65472K), 0.2133274 secs]
120.899: [GC 120.899: [DefNew: 8128K->8128K(8128K), 0.0000550 secs]120.899: [Tenured: 50384K->2430K(57344K), 0.2216590 secs] 58512K->2430K(65472K), 0.2219384 secs]
153.968: [GC 153.968: [DefNew: 8128K->8128K(8128K), 0.0000511 secs]153.968: [Tenured: 51164K->2309K(57344K), 0.2193906 secs] 59292K->2309K(65472K), 0.2196372 secs]

-> µÎ¹ø°´Â 30Ãʸ¶´Ù ÀϾÀ¸¹Ç·Î µÎ¹ø° ¸Þ¸ð¸® ¼¼ÆÃÀÌ ÈξÀ ÁÁÀ½À» ¾Ë ¼ö ÀÖ´Ù.

[The concurrent low pause collector ÃøÁ¤¹æ¹ý]

* -verbose:gc ¿Í -XX:+PrintGCDetails ¿É¼ÇÀ» Àû¿ëÇÑ´Ù.
* CMS-initial-mark : initial marking »óÅ¿¡ ´ëÇÑ GC Åë°è¸¦ º¸¿©ÁØ´Ù.
* CMS-concurrent-mark : concurrent marking »óÅ¿¡ ´ëÇÑ GC Åë°è¸¦ º¸¿©ÁØ´Ù.
* CMS-concurrent-sweep : concurrent sweeping »óÅ¿¡ ´ëÇÑ Åë°è¸¦ º¸¿©ÁØ´Ù.
* CMS-concurrent-preclean : concurrently ÇÏ°Ô ÀÛµ¿ÇÒ ¼ö ÀÖµµ·Ï °áÁ¤µÈ ÀÛ¾÷ÀÇ Åë°è
* CMS-remark : remarking »óÅ¿¡ ´ëÇÑ Åë°è
* CMS-concurrent-reset : concurrent ÀÛ¾÷ÀÌ ³¡³ª°í ´ÙÀ½ collectionÀ» ÁغñÇÑ´Ù.

[The concurrent low pause collector »ç¿ë½Ã Parallel Minor Collection ¿É¼Ç]

* -XX:+UseParNewGC : ´ÙÁß CPU¿¡¼­ ¸ÖƼ¾²·¹µå¸¦ »ç¿ëÇÑ young generation collectionÀ» »ç¿ëÇÏ´Â ¿É¼Ç.
* -XX:+CMSParallelRemarkEnabled : remark ½Ã ÀϽà Áß´ÜÀ» ¸ØÃß´Â ¿É¼Ç
±×·¯³ª ÀÌ ¿É¼ÇÀº jvm 1.4.2 ¿¡¼­ ¹ö±×·Î ÆǸíµÇ¾î (-) ·Î »ç¿ëÇØ¾ß ÇÑ´Ù.
default °¡ (+) À̹ǷΠ-XX:-CMSParallelRemarkEnabled ¸í½ÃÀûÀ¸·Î »ç¿ëÇÔ.
JVM 1.5.0 (tiger)¿¡¼­´Â ÇØ°áµÇ¾úÀ½

[±âŸ ¿É¼Ç]

1. -XX:MaxTenuringThreshold=0

default´Â 31 À̸ç ÀÌ ¿É¼ÇÀº young generation ½Ã¿¡ °´Ã¼°¡ »ì¾Æ ÀÖÀ» ¼ö ÀÖ´Â age ¸¦ ³ªÅ¸³½´Ù.
ÀÌ ¿É¼ÇÀÌ 0 °¡ µÇ¸é young generation ½Ã¿¡ older generation ¿¡ ³²¾ÆÀÖ´Â °´Ã¼°¡ º¹»çµÇ´Â
½Ã°£À» ÁÙÀÏ ¼ö ÀÖ´Ù.

2. -XX:CMSInitiatingOccupancyFraction=60

ÀÌ ¿É¼ÇÀÇ °ªÀÌ Æ¯Á¤ ÁöÁ¤ÇÑ °ªº¸´Ù ÀÛÀ¸¸é gc °¡ ÀÚÁÖ ÀϾ¸é °ªÀÌ Å©¸é gc ÀÇ È¿À²ÀÌ ¶³¾îÁú ¼ö ÀÖ´Ù.
±×·¯¹Ç·Î ÇØ´ç °ªÀ» Àß Á¤ÇÏ´Â °ÍÀÌ ÁÁÀ¸¸ç ÀϹÝÀûÀ¸·Î 60 À¸·Î ¼¼ÆÃÇÏ¿© ·Î±×¸¦ º¸°í Á¶ÀýÇÏ¸é µÈ´Ù.


[ ±âŸ »çÇ×]

1. jsp ¿Í °°ÀÌ µ¿ÀûÀ¸·Î generation µÇ´Â ¾îÇø®ÄÉÀ̼ÇÀº permanent generation ÀÌ ¼º´ÉÀúÇÏÀÇ ÇÑ ¿ä¼Ò°¡ µÉ ¼ö ÀÖÀ¸¹Ç·Î
-XX:MaxPermSize=256m ¿Í °°Àº ¿É¼ÇÀ» »ç¿ëÇÏ¿© ÇØ´ç ¸Þ¸ð¸®¸¦ ´Ã·ÁÁÙ ÇÊ¿ä°¡ ÀÖ´Ù.

2. ÇÁ·Î±×·¡¸Ó°¡ System.gc() ¸¦ È£ÃâÇϸé major gc °¡ ÀϾ¹Ç·Î ¼º´ÉÀÇ ¿µÇâÀ» ÁÙ ¼ö ÀÖ´Ù.
±×·¯¹Ç·Î -XX:+DisableExplicitGC ¿É¼ÇÀ» »ç¿ëÇÏ¿© ÇÁ·Î±×·¡¸Ó°¡ gc ¸¦ ÀÏÀ¸Å°Áö ¾Êµµ·Ï Á¦ÇÑÇØ¾ß ÇÑ´Ù.
JVM 1.4.2 ¿¡¼­´Â ¹ö±×°¡ ÀÖ¾î -XX:-DisableExplicitGC ¿Í °°ÀÌ (-) ·Î »ç¿ëÇØ¾ß ÇØ´ç ±â´ÉÀ» Àû¿ëÇÒ ¼ö ÀÖ´Ù.

3. Concurrent low pause collector ´Â Parallel Collector ¿Í Concurrent mark-sweep (CMS) collector ÀÇ ±â´ÉÀ»
¸ðµÎ °¡Áö°í ÀÖ´Ù.


[example]
java -Xmx512m -Xms512m -XX:MaxNewSize=24m -XX:NewSize=24m -XX:SurvivorRatio=128 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=0 -XX:CMSInitiatingOccupancyFraction=60
------------------------------------

°ü·Ã±Û : 1 °Ç ±Û¾´½Ã°£ : 2009/06/24 10:46 from 203.236.3.229

 

Á¦ ¸ñ

Á¶È¸

³¯Â¥

±Û¾´ÀÌ

[ÀÀ´ä]gc Àå¾ÖÁø´Ü

13051

2006.06.20

asdas


  gc Àå¾ÖÁø´Ü ¸ñ·Ïº¸±â »õ±Û ¾²±â Áö¿ì±â ÀÀ´ä±Û ¾²±â ±Û ¼öÁ¤ GC ¸ð´ÏÅ͸µ  
BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡