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

ÔÚlinux/unixÏ£¬ÄãÊÇÔõôÖÐÖ¹Ò»¸öjava½ø³ÌµÄ£¿


ÔÚlinux/unixÏ£¬ÄãÊÇÔõôÖÐÖ¹Ò»¸öjava½ø³ÌµÄ£¿
Äã¿ÉÄÜ»á»Ø´ð kill -9 pid£¬ÕâÊÇÒ»ÖÖÔÚ¶àÊýÇé¿öÏÂÕýÈ·µÄ×ö·¨¡£²»¹ý£¬ÕâÖÖ·½Ê½¹ýÓÚ±©Á¦£¬Èç¹ûÓû§¶Ô»·¾³²»ÊìϤ£¬ºÜÈÝÒ×Ôì³ÉÖÂÃüµÄºó¹û¡£
±¾ÎĽ«·ÖÎökill -9²úÉúÎÊÌâµÄÔ­Òò£¬²¢¸ø³öÁíÒ»ÖÖ±ê×¼µÄkill·½Ê½¡£
±ê×¼ÖжÏÐźÅ
ÔÚLinuxÐźŻúÖÆÖУ¬´æÔÚ¶àÖÖ½ø³ÌÖжÏÐźţ¨LinuxÐźÅÁÐ±í£©¡£ÆäÖбȽϵäÐ͵ÄÓÐ SIGNKILL£¨9£© ºÍ SIGNTERM£¨15£©.
SIGNKILL£¨9£© ºÍ SIGNTERM£¨15£© µÄÇø±ðÔÚÓÚ£º
SIGNKILL£¨9£© µÄЧ¹ûÊÇÁ¢¼´É±ËÀ½ø³Ì. ¸ÃÐźŲ»Äܱ»×èÈû, ´¦ÀíºÍºöÂÔ¡£
SIGNTERM£¨15£© µÄЧ¹ûÊÇÕý³£Í˳ö½ø³Ì£¬Í˳öǰ¿ÉÒÔ±»×èÈû»ò»Øµ÷´¦Àí¡£²¢ÇÒËüÊÇLinuxȱʡµÄ³ÌÐòÖжÏÐźš£
Óɴ˿ɼû£¬SIGNTERM£¨15£© ²ÅÊÇÀíÂÛÉϱê×¼µÄkill½ø³ÌÐźš£
ÄÇʹÓà SIGNKILL£¨9£© ÓÖÓÐʲô´íÄØ£¿
SIGNKILL£¨9£© ´øÀ´µÄÎÊÌâ
ÏÈ¿´Ò»¶Î³ÌÐò
/**
* Shutdown Hook Presentation
*
* @author Ken Wu
*/
public class ShutdownHookTest {
 
private static final void shutdownCallback() {
System.out.println("Shutdown callback is invoked.");
}
 
public static void main(String[] args) throws InterruptedException {
Runtime.getRuntime().addShutdownHook(new Thread() {
 
@Override
public void run() {
shutdownCallback();
}
 
});
Thread.sleep(10000);
}
 
}
ÔÚÉÏÃæÕâ¶Î³ÌÐòÖУ¬ÎÒʹÓÃRuntimeΪµ±Ç°java½ø³ÌÌí¼ÓÁËÒ»¸öShutdownHook£¬ËüµÄ×÷ÓÃÊÇÔÚjavaÕý³£Í˳öʱ£¬Ö´ÐÐshutdownCallback()Õâ¸ö»Øµ÷·½·¨¡£
´Ëʱ£¬Èç¹ûÄãÊÔÑé¹ýÔÚjava½ø³Ìδ×Ô¶¯Í˳öǰ£¬Ö´ÐÐ kill -9 pid£¬¼´·¢ËÍ SIGNKILL Ðźţ¬»á·¢ÏÖÕâ¸ö»Øµ÷½Ó¿ÚÊDz»»á±»Ö´Ðеġ£ÕâÊÇSIGNKILLÐÅºÅÆðµÄ×÷Óá£
¶ÔÓÚÎÒÕâ¸ö¼òµ¥µÄ²âÊÔÓÃÀýÀ´Ëµ£¬²»±»Ö´ÐÐÒ²ÎÞ´ó°­¡£µ«ÊÇ£¬Èç¹ûÄãµÄÕæÊµÏµÍ³ÖÐÓÐÐèÒªÔÚjava½ø³ÌÍ˳öºó£¬ÊÍ·ÅijЩ×ÊÔ´¡£
¶øÕâ¸öÊͷŶ¯×÷£¬ÒòΪSIGNKILL±»ºöÂÔÁË£¬ÄǾͿÉÄÜÔì³ÉһЩÎÊÌâ¡£
ËùÒÔ£¬ÍƼö´ó¼ÒʹÓñê×¼µÄkill½ø³Ì·½Ê½£¬¼´ kill -15 pid¡£
×÷ÕߣºKen Wu Ô­ÎÄÁ´½Ó£ºhttp://kenwublog.com/kill-java-correctly


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

javaµÄÄÚ´æºÍ¶ÑÕ»

Ô­ÎĵØÖ·£ºÎªÁ˱¸Íü£¬×ªÔØ×Ôhttp://www.j2megame.org/index.php/content/view/1989/125.html
1. javaÖжÑÓëÕ»
ÔÚJava³ÌÐòÔËÐÐʱ£¬ÓÐ6¸öµØ·½¿ÉÒÔÓÃÓÚ±£´æÊý¾Ý£º
(1) ¼Ä´æÆ÷¡£×î¿ìµÄ±£´æÇøÓò£¬Î»ÓÚ´¦ÀíÆ÷ÄÚ²¿,ÊýÁ¿Ê®·ÖÓÐÏÞ£¬ËüÊǸù¾ÝÐèÒªÓɱàÒëÆ÷·ÖÅä¡£ÎÒÃǶԴËûÓÐÖ±½ÓµÄ¿ØÖÆÈ¨.
(2)
Õ»(stack)¡£×¤ÁôÓÚ³£¹æRAM£¨Ëæ»ú ......

Java Web Start

Java Web Start ÊǰïÖú¿Í»§»ú¶ËÓ¦ÓóÌÐò¿ª·¢µÄÒ»¸öм¼Êõ£¬ËüµÄ¶ÀÌØÖ®´¦ÔÚÓÚ½«Äú´Ó¹ØÐĿͻ§»úÊÇÈçºÎÆô¶¯µÄ£¨´Ó Web ä¯ÀÀÆ÷»òÊÇ×ÀÃæ£©Öнâ·Å³öÀ´¡£ÁíÍ⣬¸Ã¼¼ÊõÌṩÁËÒ»¸öʹ Web ·þÎñÆ÷ÄܶÀÁ¢µÄ·Ö·¢ºÍ¸üпͻ§»ú´úÂëµÄ¼¯ºÏ²¿Êð·½°¸¡£
    Java Web Start ÊÇÒ»¸öÈí¼þ¼¼Êõ£¬Ëü°üº¬ÁË applet µÄ¿ÉÒÆÖ²ÐÔ¡¢Servl ......

LinuxÆô¶¯¹ý³Ì£¨±Ê¼Ç£©

Ê×ÏÈ£º´ò¿ªPCµçԴʱ£¬CPU×Ô¶¯½øÈëʵģʽ£¬²¢´ÓµØÖ·0xFFFF0¿ªÊ¼Ö´ÐдúÂ룬Õâ¸öµØÖ·Í¨³£ÊÇROM-BIOSÖеĵØÖ·¡£ÕâʱBIOS½øÐпª»ú×Լ죬²¢°´BIOSÖÐÉèÖúõIJÎÊý½øÐÐÆô¶¯É豸£¬½Ó×ÅÆô¶¯É豸Éϰ²×°µÄÒýµ¼³ÌÐòlilo»ògrub¿ªÊ¼Òýµ¼LINUX£¨Ò²¾ÍÊÇÆô¶¯É豸µÄµÚÒ»¸öÉÈÇø£©£¬Õâʱ£¬Linux²Å»ñµÃÆô¶¯È¨¡£
      µ ......

linuxÃüÁîϵÁÐÖ®Ò»

du wzwz -h                  ²é¿´Ä¿Â¼»òÕßÎļþwzwzÕ¼ÓÿռäµÄ´óС
ls -1                        &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ