Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ǶÈëʽ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²Ù×÷ϵͳÏÂÈýÖÖÅäÖû·¾³±äÁ¿µÄ·½·¨


ÏÖÔÚʹÓÃlinuxµÄÅóÓÑÔ½À´Ô½¶àÁË£¬ÔÚlinuxÏÂ×ö¿ª·¢Ê×ÏȾÍÊÇÐèÒªÅäÖû·¾³±äÁ¿£¬ÏÂÃæÒÔÅäÖÃjava»·¾³±äÁ¿ÎªÀý½éÉÜÈýÖÖÅäÖû·¾³±äÁ¿µÄ·½·¨¡£
 
1.ÐÞ¸Ä/etc/profileÎļþ
Èç¹ûÄãµÄ¼ÆËã»ú½ö½ö×÷Ϊ¿ª·¢Ê¹ÓÃʱÍƼöʹÓÃÕâÖÖ·½·¨£¬ÒòΪËùÓÐÓû§µÄshell¶¼ÓÐȨʹÓÃÕâЩ»·¾³±äÁ¿£¬¿ÉÄÜ»á¸øϵͳ´øÀ´°²È«ÐÔÎÊÌâ¡£
 
(1)Ó ......

Linux »·¾³±äÁ¿×ܽá

1¡¢ÒýÑÔ
   
ÔÚ
linuxϵͳ
Ï£¬Èç¹ûÄãÏÂÔز¢°²×°ÁËÓ¦ÓóÌÐò£¬ºÜÓпÉÄÜÔÚ¼üÈëËüµÄÃû³Æʱ³öÏÖ“
command not found
”µÄÌáʾÄÚÈÝ¡£Èç¹ûÿ´Î¶¼µ½°²×°Ä¿±êÎļþ¼ÐÄÚ£¬ÕÒµ½¿ÉÖ´ÐÐÎļþÀ´½øÐвÙ×÷¾ÍÌ«·±ËöÁË¡£ÕâÉæ¼°µ½»·¾³±äÁ¿
PATH
µÄÉèÖÃÎÊÌ⣬¶ø
PATH
µÄÉèÖÃÒ²ÊÇÔÚ
linux
϶¨ÖÆ»·¾³±äÁ¿µ ......

linux²Ù×÷ϵͳ°²×°python3

Ê×ÏÈÊÇÏÂÔØpython3£¬ÏÖÔÚµÄ×î¸ß°æ±¾ÊÇ3.1.1
for linux¡£
ÎҵķÅÖ÷¾¶ÊÇ/home/pythonÏ·ÅÖÃPython-3.1.1.tgz,Ö´ÐÐÒÔÏÂϵÁвÙ×÷£º
1.½âѹ£ºtar zxvf Python-3.1.1.tgz----Éú³É½âѹ°üPython-3.1.1
2.ת»»µ½Python-3.1.1·¾¶Ï£¬Ö´ÐÐ./configure
3.make
4.make install
ÔÚrehl5ÖÐÒѾ­Ä¬ÈÏ°²×°ÁËpython2.4,ËùÒÔÒª×öÈçÏ ......

linux shell pid

¼ÙÉèÊÇÆô¶¯Ò»¸ö rails ³ÌÐò£º
ruby script/server
ͨ³£»áÕâÑù£º
nohup ruby script/server &
°Ñ´íÎóÊä³öÁ÷Ò²¶¨Ïòµ½Õý³£Êä³öÁ÷ÖУº
nohup ruby script/server & 2 > 1 &
Òª¼Ç¼Ï pid £º
nohup ruby script/server & 2 > 1 & echo $! > tmp/pid &
¾­¹ý·´¸´µ÷ÊÔ£¬ÉÏÃæµÄÓï¾äËƺõ²»Í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ