ǶÈëʽLinuxÎïÀíÄÚ´æÓ³Éä
The physical memory map for Linux is completely independent from the virtual map and is designed to maximize contiguous space. Given that the kernel image will always be at the start of DRAM, the Linux kernel maximizes contiguous space by allocating runtime memory from the end of physical DRAM moving downward.
The kernel starts by breaking available memory out into large, contiguous blocks (typically 4MB or more).It then maintains memory using the buddy system, where physical memory is always allocated in combinations of blocks of 2^n pages (where n is the order, that is, 4K is a 0 order block, 8K is a 1st order block, 16K is a 2nd order block, etc).
LinuxÎïÀíÄÚ´æµÄÓ³ÉäÍêÈ«¶ÀÁ¢ÓÚÐéÄâÄÚ´æµÄÓ³É䣬¶øÇÒ¾¡¿ÉÄÜÓ³Éäµ½Á¬ÐøµÄ¿Õ¼ä¡£¼Ù¶¨ÄÚºËÓ³Ïñ×ÜÊÇλÓÚDRAMµÄ¿ªÊ¼´¦£¬LinuxÄں˾¡¿ÉÄÜÈÿռäÁ¬Ðø£¬ÕâÊÇͨ¹ý´ÓÎïÀíDRAMµÄÄ©¶ËÏòÏÂÒÆ¶¯À´·ÖÅäÔËÐÐʱÄÚ´æ¶ø´ïµ½µÄ¡£
ÄÚºËÒ»¿ªÊ¼°Ñ¿ÉÓÃÄÚ´æ·Ö¸îΪ´ó¶øÁ¬ÐøµÄ¿é£¨Í¨³£Îª4MB »ò¸ü¶à£©¡£´Ëºó£¬ÄÚºËÀûÓûï°éËã·¨À´¹ÜÀíÄڴ棬ÕâÀÎïÀíÄÚ´æµÄ·ÖÅä×ÜÊÇ2^n¸öÒ³ËùÐγɿéµÄ×éºÏ£¨ÕâÀnÊÇÃÝ£¬4k¾ÍÊÇÃÝΪ0µÄ¿é£¬8KÊÇÃÝΪ1¿é£¬16KΪÃÝΪ2µÄ¿é£¬Èç´ËµÈµÈ£©¡£
When physical memory is allocated, that is, on process start, or when malloc’ed memory is written to (copy-on-write), the kernel scans for the smallest order block that will fill fit starting from the top of DRAM. As the number of running processes increases, or new allocations are spawned from drivers or processes, the physical memory used grows downward.
µ±ÎïÀíÄÚ´æ·ÖÅäʱ£¬Ò²¾ÍÊÇÔÚ½ø³Ì¸Õ¿ªÊ¼Ê±£¬»òÕß˵µ±·ÖÅäµÄÄڴ汻дÈëʱ£¨Ð´Ê±¸´ÖÆ£©£¬ÄÚºËɨÃè×îСÃݴεĿ飨´ÓDRAM¶¥²¿¿ªÊ¼Ñ°ÕÒ×îºÏÊʵģ©¡£Ëæ×Žø³ÌÊýµÄÔö¼Ó£¬»òÕßÀ´×ÔÇý¶¯³ÌÐò»ò½ø³ÌзÖÅäµÄÂûÑÓ£¬ËùʹÓõÄÎïÀíÄÚ´æÏòÏÂÑÓÉì¡£
When a process exits or a large enough memory block is freed, its DRAM space is unmapped and becomes a gap in memory. This process is called memory fragmentation and becomes more and more prevalent the longer a device is used and the more frequently
Ïà¹ØÎĵµ£º
LINUX´®¿Ú¼òÃ÷½âÎö[ÐÞÕý°æ][0919]
09-14
ÉÏÖܵÄʱºò£¬·¢ÁËÆªÎÄÕ£¬¹ØÓÚlinux´®¿ÚµÄ¡¾µ±È»³ÌÐòʦת±ðÈ˵썻¹ÊÇ·¢²¼ÔÚIBM¿ª·¢ÕßÉçÇøµÄàÏ£©¡¿£¬
ËäÈ»µ±Ê±ÄÜÅܵÄͨ£¬µ«ÕâÖÜÔÚÓõÄʱºòÈ´·¢ÏÖ²»ÐÐÁË£¬ÓÚÊǾö¶¨×ÐϸÑо¿ÏÂlinuxÏ´®¿ÚÕâ¶«Î÷£¡
µ±È»ÄǸö³ÌÐòÓÐÎÊÌ⣬¾ÍÒª×Ô¼ºÖØÐÂдÀ²¡£¡£¡£¡£¡£¡£OTZ ¡£¡£¡£¡£¶ö¡£¡£¡£ÎÒÏòÀ´±È ......
JSPÔ´´úÂë
<%
//»ñȡϵͳʱ¼ä
//String ddate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
TimeZone tz = TimeZone.getTimeZone("ETC/GMT-8");
TimeZone.setDefault(tz);
  ......
¼ÙÉèÊÇÆô¶¯Ò»¸ö rails ³ÌÐò£º
ruby script/server
ͨ³£»áÕâÑù£º
nohup ruby script/server &
°Ñ´íÎóÊä³öÁ÷Ò²¶¨Ïòµ½Õý³£Êä³öÁ÷ÖУº
nohup ruby script/server & 2 > 1 &
Òª¼Ç¼Ï pid £º
nohup ruby script/server & 2 > 1 & echo $! > tmp/pid &
¾¹ý·´¸´µ÷ÊÔ£¬ÉÏÃæµÄÓï¾äËÆºõ²»Í ......
ѧϰlinuxϵÄc/c++±à³Ì
1£¬ÏÈÓÐlinux»·¾³
´îminGWºÍcygwin¶¼ÓеãÂé·³£¬×î×î¼òµ¥µÄ°ì·¨»¹ÊÇ×°¸öÕæÕýµÄlinux£¬ÓÃÐéÄâ»úÒ²ºÃ£¬ÔÚÍøÂçÉϵÄÁíһ̨»úÆ÷Ò²ºÃ¡£ÕâÑù²»½ö¿ì£¬¶øÇÒÄãÓÐÁËÕæÕýµÄ»·¾³¡£
2.»áC/C++ÓïÑÔ£¨¹À¼ÆÄã»áµÄ£©
3.ÈëÃŽ׶ÎÊìϤgccÃüÁîÐУ¬×î»ù±¾µÄ²ÎÊý£¬È磬-g,-W,-O,-o,-c ½¨Òé¿´man gcc(ºÜ´óÕÒÏ ......
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
½üÈÕ£¬ÔÚLinuxCON 2009´ó»áÉÏ£¬×ÀÃæ
Linux
ÓÖ³ÉΪҵ½ç¹Ø×¢µÄ½¹µãÖ®Ò»¡£¸÷ÖÖ²»Í¬µÄÉùÒô£¬É¤ÃŶ¼ºÜ´ó¡£ÔÚÕâ·×·×ÈÂȵķÕΧÖУ¬
Linux
ÈçºÎ×ß³ö×ÀÃæÀ§¾³£¿
& ......