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

Ò»ÖÖ¶¨Î»ÄÚ´æй¶µÄ·½·¨£¨Linux£©

Ä¿µÄ£º
±¾ÎÄÊÇ¡¶Ò»ÖÖ¶¨Î»ÄÚ´æй¶µÄ·½·¨£¨Solaris£©¡·¶ÔÓ¦µÄLinux°æ±¾£¬µ÷ÊÔÆ÷ʹÓÃgdb¡£Ö÷Òª½éÉÜʵÀý²¿·Ö¡£ÆäËûÇë¼û¡¶Ò»ÖÖ¶¨Î»ÄÚ´æй¶µÄ·½·¨£¨Solaris£©¡·¡£
ʵÀý£º
Ä£Äânewʧ°ÜµÄ³ÌÐò£º
#include <stdexcept>
class ABC
{
public:
        virtual ~ABC(){}
        int i;
        int j;
};
 
void f()
{
        for (int i = 0; i < 1000; ++i)
        {
                ABC* p = new ABC;
        }
        throw std::bad_alloc();
}
 
int main()
{
        f();
        return 0;
}
1£© ±àÒëÔËÐд˶δúÂë¡£²úÉúÒ»¸öcoreÎļþ
2£© ÓÃgdb´ò¿ªÕâ¸öcoreÎļþ£º
gdb a.out core
(gdb) run
Starting program: /test/new_fail/a.out
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
 
Program received signal SIGABRT, Aborted.
0x00007ffff733f645 in raise () from /lib64/libc.so.6
(gdb) info proc
process 10683
cmdline = '/test/new_fail/a.out'
cwd = '/test/new_fail'
exe = '/test/new_fail/a.out'
(gdb) shell pmap 10683
10683: a.out
START               SIZE     RSS     PSS   DIRTY    SWAP PERM MAPPING
0000000000400000      4K      4K      4K      0K      0K r-xp /test/new_fail/a.out
0000000000600000      4K      4K      4K      4K      0K r--


Ïà¹ØÎĵµ£º

Linux½ø³Ì¼äͨѶ֮¹²ÏíÄÚ´æ

¹²ÏíÄÚ´æ:
ʹÓù²ÏíÄÚ´æºÍʹÓÃmalloc()À´·ÖÅäÄÚ´æÇøÓòºÜÏàËÆ¡£Ê¹Óù²ÏíÄÚ´æµÄ·½·¨ÊÇ£º
    1 ¶ÔÒ»¸ö½ø³Ì/Ïß³ÌʹÓÃshmget()·ÖÅäÄÚ´æÇøÓò¡£
    2 ʹÓÃshmat()·ÅÖÃÒ»¸ö»ò¶à¸ö½ø³Ì/Ïß³ÌÔÚ¹²ÏíÄÚ´æÖУ¬Ò²¿ÉÒÔÓÃshmctl()À´»ñÈ¡ÐÅÏ¢»òÕß¿ØÖƹ²ÏíÇøÓò¡£
    3 ʹÓÃshmdt()´Ó¹²Ïí ......

linux°üÒÀÀµÎÊÌâ½â¾ö

×òÌìÍíÉÏ×¼±¸×°subversion ½á¹ûÅöµ½Ò»¸öºÜÄÕ»ðµÄÎÊÌâ
[root@rhel6beta Packages]# rpm -ivh libproxy-0.3.0-1.el6.i686.rpm
warning:
libproxy-0.3.0-1.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID
f21541eb: NOKEY
error: Failed dependencies:
        libproxy-b ......

²¦¿ªÃÔÎí µ¥Æ¬»úºÍǶÈëʽLINUX¿ª·¢µÄÄǵãʶù

×÷ÕߣºÎ¤¶«É½,»ªÇåÔ¶¼ûǶÈëʽѧԺ½²Ê¦¡£
Ëæ×ÅǶÈëʽÐÐÒµÓ²¼þƽ̨µÄÐÔÄÜÔöÇ¿£¬ÏîÄ¿ÐèÇóºÍ¹¦ÄÜÈÕÒ渴ÔÓ£¬ARM¹«Ë¾ÍƳöµÄ CORTEX-M3£¬¸üÊÇÈÃÒÔÍù×öµ¥Æ¬»úµÄ¹¤³ÌʦÔÚоƬºÍ¼¼ÊõÑ¡ÐÍÃæÁÙÁ½ÄÑÑ¡Ôñ£¬±¾×¨Ì⽫´ÓоƬ¼Û¸ñ¡¢Õû¸öϵͳµÄÓ²¼þÈí¼þÉè¼Æ¼°Î¬»¤µÄ³É±¾µÈ¸÷¸ö·½Ãæ¸øÄúÌṩһ¸ö²Î¿¼£¬ ²¢´Ó¼¼Êõ½Ç¶È·ÖÎöµ¥Æ¬»úºÍ´ø²Ù×÷ϵͳµÄÏµÍ ......

Linuxϲ鿴ÎļþºÍÎļþ¼Ð´óСµÄdfºÍduÃüÁî

ת×Ô£ºhttp://www.yayu.org/look.php?id=162
µ±´ÅÅÌ´óС³¬¹ý±ê׼ʱ»áÓб¨¾¯Ìáʾ£¬ÕâʱÈç¹ûÕÆÎÕdfºÍduÃüÁîÊǷdz£Ã÷ÖǵÄÑ¡Ôñ¡£
    df¿ÉÒԲ鿴һ¼¶Îļþ¼Ð´óС¡¢Ê¹ÓñÈÀý¡¢µµ°¸ÏµÍ³¼°Æä¹ÒÈëµã£¬µ«¶ÔÎļþÈ´ÎÞÄÜΪÁ¦¡£
    du¿ÉÒԲ鿴Îļþ¼°Îļþ¼ÐµÄ´óС¡£
    Á½ÕßÅäºÏʹÓã ......

linux signalº¯Êý

CÓïÑÔÖеijéÏóº¯Êý¶¨ÒåÒ²¾ÍÊÇʹÓÃÁ˺¯ÊýÖ¸Õ룬ÕâÀïÓÃsignalº¯Êý½âÊÍһϳéÏóº¯Êý¶¨ÒåµÄº¬ÒåºÍ¹æÔò¡£
signalº¯Êý¶¨ÒåΪ£º
void (   * signal (int signum , void (*handler)(int)  )   )(int);
 
¿ÉÒÔÕâÑù¶¨Òå
typedef  void(* handler) (int)
handler signal(int signum,handler) ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ