# # ¿Ö swap space´Â ÀÚ²Ù ÁÙ¾îµé±î? # process size´Â ´Ã¾î³ªÁö ¾Ê´Âµ¥, ¿Ö swap space´Â ÀÚ²Ù ÁÙ¾îµé±î ? ÀÌ·¯ÇÑ Çö»óÀº ´ÙÀ½ÀÇ µÎ°¡Áö ¿øÀο¡ ÀÇÇؼ­ ÀϾ ¼ö ÀÖ´Ù. ¨± default·Î /tmp filesystemÀÌ swap device¿¡ mountµÇ¾îÀÖ°í, ´õ ¸¹Àº °ÍµéÀ» /tmp ¿¡ ³ÖÀ¸¸é ´õ ÀÛÀº ¾çÀÇ swap space°¡ ³²°Ô µÈ´Ù. swap device´Â efficient temporary filesystemÀ» Á¦°øÇϱâ À§ÇÏ¿© »ç¿ëµÇ¾îÁø´Ù. RAM disk¿Í´Â ´Ù¸£°Ô tmpfs´Â Ä¿Áö°Å³ª ÀÛ¾ÆÁú¼ö Àֱ⠶§¹®¿¡, memoryÀÇ ÀÏÁ¤·®À» allocateÇؾ߸¸ÇÏ´Â ´ÜÁ¡¾øÀÌ fast RAM based filesystemÀÇ ÀåÁ¡À» ¾òÀ» ¼ö ÀÖ´Ù. ¨² ps commandÀÇ outputÁß SZ columnÀº virtual memory system¿¡ ÀÖ´Â processÀÇ real size¸¦ ³ªÅ¸³»°í ÀÖÁö ¾Ê´Ù´Â °ÍÀ» À¯³äÇؾ߸¸ ÇÑ´Ù. Ưº°ÇÑ Á¡À̶ó¸é, memory allocationÀº SVR4ÇÏÀÇ lazy fashion¿¡¼­ ÀÌ·ç¾îÁø´Ù´Â Á¡ÀÌ´Ù. ( RAMÀ̳ª anonymous memory-another name for swap-´Â process°¡ ÇÊ¿ä·Î ÇÒ¶§¶ó¾ß allocationÀÌ µÈ´Ù. ) ¸¸ÀÏ ps·Î 100ÆäÀÌÁöÀÇ ÇÁ·Î¼¼½º°¡ º¸¿´´Ù°í ÇÑ´Ù¸é, ÀÌ´Â ÇöÀç »ç¿ëµÇ°í ÀÖ´Â processÀÎÁöÀÇ ¿©ºÎ¿¡ °ü°è¾øÀÌ reserveµÇ¾î ÀÖ´Â °ÍÀÌ º¸ÀÏ »ÓÀÌ´Ù. psÀÇ °á°ú¸¦ º¸´Â ½ÃÁ¡¿¡´Â memoryÀÇ ¹ÝÀÌ ÇÊ¿äÇÏ¿´°í, ½Ã°£ÀÌ °¥¼ö·Ï ±× »ç¿ë·®ÀÌ ´Ã¾î³­´Ù°í Çصµ ps °á°úÄ¡ÀÇ ¾çÀº º¯ÇÏÁö ¾Ê´Â´Ù. ¸¸ÀÏ ÇÁ·Î±×·¥ÀÌ run time±îÁö memory°¡ allocateÇϴµ¥ ¾ó¸¶³ª ÇÊ¿äÇÑÁö¸¦ ¾ËÁö ¸øÇÑ´Ù¸é (´ëºÎºÐÀÇ °æ¿ì¿¡´Â »ç¿ëÀÚÀÇ input¿¡ ÀÇÇØ ¾îµð¿¡ memory°¡ ÀÖ´ÂÁö¸¦ ¾Ë¼ö ÀÖÁö¸¸) ps(1)ÀÇ SZ columnÀ» »ìÆ캸¾Æ¾ß ÇÒ °ÍÀÌ´Ù. ¿Ö³ÄÇϸé ÀÌ°ÍÀº process°¡ reserveÇϴµ¥ ÇÊ¿äÇÑ memoryÀÇ ÃÑ·®À» °è»êÇÒ ¼ö ¾ø±â ¶§¹®ÀÌ´Ù.