ZZ: When Linux Runs Out of Memory (OOM killer)
When Linux Runs Out of Memory
http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html?page=1
Perhaps you rarely face it, but once you do, you surely know what's
wrong: lack of free memory, or Out of Memory (OOM). The results are
typical: you can no longer allocate more memory and the kernel kills a
task (usually the current running one). Heavy swapping usually
accompanies this situation, so both screen and disk activity reflect
this.
At the bottom of this problem lie other questions: how much memory
do you want to allocate? How much does the operating system (OS)
allocate for you? The basic reason of OOM is simple: you've asked for
more than the available virtual memory space. I say "virtual" because
RAM isn't the only place counted as free memory; any swap areas apply.
Exploring OOM
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......
ÎÞÂÛÊÇVC»¹ÊÇVB£¬»¹ÊÇC#£¬»¹ÊÇJSP PHPµÈµÈÓïÑÔ£¬ÔÚѧϰËûÃÇ֮ǰ×ÜÊÇÏÈÀ´Ò»¸öHELLO
WORLDµÄÀý×Ó£¬Õâ¸öºÃÏñ³ÉÁËÎÒÃdzÌÐòÈëÃŵıؾ֮·¡£ËùÒÔÔÚÇý¶¯³ÌÐòµÄѧϰÉÏ£¬Ò²Àë²»¿ªÕâ¸ö²½Öè¡£µ«ÊÇÇý¶¯³ÌÐòµÄ¿ª·¢ÊÇÔËÐÐÔÚÄں˿ռäµÄ£¬¶øÓ¦ÓóÌÐò
ÊÇÔËÐÐÔÚÓû§¿Õ¼äµÄ£¬ËùÒÔÇý¶¯³ÌÐòµÄ¿ª·¢ºÐµ÷ÊÔºÍÓ¦ÓóÌÐòµÄ¿ª·¢¶¼ÓкܴóµÄÇø±ð¡£¶ÔÓÚÕ ......