javaÄÚ´æ»ØÊÕ»úÖÆ
ÒýÑÔ
JavaµÄ¶ÑÊÇÒ»¸öÔËÐÐʱÊý¾ÝÇø,ÀàµÄʵÀý(¶ÔÏó)´ÓÖзÖÅä¿Õ¼ä¡£JavaÐéÄâ»ú(JVM)µÄ¶ÑÖд¢´æ×ÅÕýÔÚÔËÐеÄÓ¦ÓóÌÐòËù½¨Á¢µÄËùÓжÔÏó£¬ÕâЩ¶ÔÏóͨ¹ýnew¡¢newarray¡¢anewarrayºÍmultianewarrayµÈÖ¸ÁÁ¢£¬µ«ÊÇËüÃDz»ÐèÒª³ÌÐò´úÂëÀ´ÏÔʽµØÊÍ·Å¡£Ò»°ãÀ´Ëµ£¬¶ÑµÄÊÇÓÉÀ¬»ø»ØÊÕ À´¸ºÔðµÄ£¬¾¡¹ÜJVM¹æ·¶²¢²»ÒªÇóÌØÊâµÄÀ¬»ø»ØÊÕ¼¼Êõ£¬ÉõÖÁ¸ù±¾¾Í²»ÐèÒªÀ¬»ø»ØÊÕ£¬µ«ÊÇÓÉÓÚÄÚ´æµÄÓÐÏÞÐÔ£¬JVMÔÚʵÏÖµÄʱºò¶¼ÓÐÒ»¸öÓÉÀ¬»ø»ØÊÕËù¹ÜÀíµÄ¶Ñ¡£À¬»ø»ØÊÕÊÇÒ»ÖÖ¶¯Ì¬´æ´¢¹ÜÀí¼¼Êõ£¬Ëü×Ô¶¯µØÊͷŲ»ÔÙ±»³ÌÐòÒýÓõĶÔÏ󣬰´ÕÕÌض¨µÄÀ¬»øÊÕ¼¯Ëã·¨À´ÊµÏÖ×ÊÔ´×Ô¶¯»ØÊյŦÄÜ¡£
À¬»øÊÕ¼¯µÄÒâÒå
ÔÚC++ÖУ¬¶ÔÏóËùÕ¼µÄÄÚ´æÔÚ³ÌÐò½áÊøÔËÐÐ֮ǰһֱ±»Õ¼Óã¬ÔÚÃ÷È·ÊÍ·Å֮ǰ²»ÄÜ·ÖÅä¸øÆäËü¶ÔÏ󣻶øÔÚJavaÖУ¬µ±Ã»ÓжÔÏóÒýÓÃÖ¸ÏòÔÏÈ·ÖÅä¸øij¸ö¶ÔÏóµÄÄÚ´æʱ£¬¸ÃÄÚ´æ±ã³ÉΪÀ¬»ø¡£JVMµÄÒ»¸öϵͳ¼¶Ï̻߳á×Ô¶¯ÊͷŸÃÄÚ´æ¿é¡£À¬»øÊÕ¼¯Òâζ×ųÌÐò²»ÔÙÐèÒªµÄ¶ÔÏóÊÇ"ÎÞÓÃÐÅÏ¢"£¬ÕâЩÐÅÏ¢½«±»¶ªÆú¡£µ±Ò»¸ö¶ÔÏó²»ÔÙ±»ÒýÓõÄʱºò£¬ÄÚ´æ»ØÊÕËüÕ¼ÁìµÄ¿Õ¼ä£¬ÒÔ±ã¿Õ¼ä±»ºóÀ´µÄжÔÏóʹÓá£ÊÂʵÉÏ£¬³ýÁËÊÍ·ÅûÓõĶÔÏó£¬À¬»øÊÕ¼¯Ò²¿ÉÒÔÇå³ýÄÚ´æ¼Ç¼ËéƬ¡£ÓÉÓÚ´´½¨¶ÔÏóºÍÀ¬»øÊÕ¼¯Æ÷ÊͷŶªÆú¶ÔÏóËùÕ¼µÄÄÚ´æ¿Õ¼ä£¬ÄÚ´æ»á³öÏÖËéƬ¡£ËéƬÊÇ·ÖÅä¸ø¶ÔÏóµÄÄÚ´æ¿éÖ®¼äµÄ¿ÕÏÐÄڴ涴¡£ËéƬÕûÀí½«ËùÕ¼ÓõĶÑÄÚ´æÒƵ½¶ÑµÄÒ»¶Ë£¬JVM½«ÕûÀí³öµÄÄÚ´æ·ÖÅä¸øеĶÔÏó¡£
À¬»øÊÕ¼¯ÄÜ×Ô¶¯ÊÍ·ÅÄÚ´æ¿Õ¼ä£¬¼õÇá±à³ÌµÄ¸ºµ£¡£ÕâʹJava ÐéÄâ»ú¾ßÓÐһЩÓŵ㡣Ê×ÏÈ£¬ËüÄÜʹ±à³ÌЧÂÊÌá¸ß¡£ÔÚûÓÐÀ¬»øÊÕ¼¯»úÖƵÄʱºò£¬¿ÉÄÜÒª»¨Ðí¶àʱ¼äÀ´½â¾öÒ»¸öÄѶ®µÄ´æ´¢Æ÷ÎÊÌâ¡£ÔÚÓÃJavaÓïÑÔ±à³ÌµÄʱºò£¬¿¿À¬»øÊÕ¼¯»úÖÆ¿É´ó´óËõ¶Ìʱ¼ä¡£Æä´ÎÊÇËü±£»¤³ÌÐòµÄÍêÕûÐÔ, À¬»øÊÕ¼¯ÊÇJavaÓïÑÔ°²È«ÐÔ²ßÂÔµÄÒ»¸öÖØÒª²¿·Ý¡£
À¬»øÊÕ¼¯µÄÒ»¸öDZÔÚµÄȱµãÊÇËüµÄ¿ªÏúÓ°Ïì³ÌÐòÐÔÄÜ¡£JavaÐéÄâ»ú±ØÐë×·×ÙÔËÐгÌÐòÖÐÓÐÓõĶÔÏó, ¶øÇÒ×îÖÕÊÍ·ÅûÓõĶÔÏó¡£ÕâÒ»¸ö¹ý³ÌÐèÒª»¨·Ñ´¦ÀíÆ÷µÄʱ¼ä¡£Æä´ÎÀ¬»øÊÕ¼¯Ëã·¨µÄ²»Í걸ÐÔ£¬ÔçÏȲÉÓõÄijЩÀ¬»øÊÕ¼¯Ëã·¨¾Í²»Äܱ£Ö¤100%ÊÕ¼¯µ½ËùÓеķÏÆúÄÚ´æ¡£µ±È»Ëæ×ÅÀ¬»øÊÕ¼¯Ëã·¨µÄ²»¶Ï¸Ä½øÒÔ¼°ÈíÓ²¼þÔËÐÐЧÂʵIJ»¶ÏÌáÉý£¬ÕâЩÎÊÌⶼ¿ÉÒÔÓÈжø½â¡£
À¬»øÊÕ¼¯µÄËã·¨·ÖÎö
JavaÓïÑԹ淶ûÓÐÃ÷È·µØ˵Ã÷JVMʹÓÃÄÄÖÖÀ¬»ø»ØÊÕËã·¨£¬µ«ÊÇÈκÎÒ»ÖÖÀ¬»øÊÕ¼¯Ëã·¨Ò»°ãÒª×ö2¼þ»ù±¾µÄÊÂÇ飺£¨1£©·¢ÏÖÎÞÓÃÐÅÏ¢¶ÔÏ󣻣¨2£©»ØÊÕ±»ÎÞÓöÔÏóÕ¼ÓõÄÄÚ´æ¿Õ¼ä£¬Ê¹¸Ã¿Õ¼ä¿É±»³ÌÐòÔÙ´ÎʹÓá£
´ó¶àÊýÀ¬»ø»ØÊÕË㷨ʹÓÃÁ˸ù¼¯(root set)Õâ¸ö¸ÅÄËùν¸ù¼¯¾ÍÁ¿Õ
Ïà¹ØÎĵµ£º
URI ÊÇ×ÊÔ´±êʶ·û¡£¾ÍÊÇÏ൱ÓÚÒ»¸öÈ˵ļÒͥסַ¡£
URLºÍURIÀàËÆ¡£ÊÇ×ÊÔ´¶¨Î»µÄ¡£ ºÍURI²»Í¬µÄ¾ÍÊÇURLÌṩÁË»ñÈ¡¶«Î÷µÄ·½·¨¡£
java.io.InputStream l_urlStream;
// Ò²¿ÉÒÔ»»³Éuri,È»ºóµ÷ÓÃuri.toURL
  ......
public class Person implements Serializable {
private String name;
private int age;
private GregorianCalendar birthday;
public Person(){
}
p ......
ºÜ¶àÈË˵C#ÊÇ΢ÈíÓÃÀ´ºÍJava¿¹ºâµÄÎäÆ÷£¬ÒòΪ¶þÕßÔںܴó³Ì¶ÈÉÏÓÐמªÈ˵ÄÏàËÆ£¬¾¡¹ÜÈç´Ë£¬Á½Õß²»Í¬µÄµØ·½Ò²ºÜ¶à£¬Ëùν“ÓÚϸ΢´¦¼û²îÒ씡£ÄÇôÁ½ÕßµÄÏàËƺÍÇø±ð¶¼ÔÚʲôµØ·½ÄØ£¿ÎÒÃÇ´Ó½ñÌ쿪ʼ£¬»á´Ó¸÷¸ö½Ç¶ÈÀ´¶Ô±ÈC#ºÍJavaµÄÌص㣬ϣÍûÄܶÔÕýÔÚѧϰ¡¢Ê¹ÓÃC#µÄÅóÓÑÓÐËù°ïÖú¡£
& Y0 f! I! a4 a1 K
% B# G8 ......
¼¶±ð£º ³õ¼¶
ÌÆ
ÏÌ·å
(hutun@263.net
),
2001 Äê 5 ÔÂ 28 ÈÕ
Ëæ×ÅJAVAµÄѸÃÍ·¢Õ¹£¬JDK°æ±¾µÄ²»¶Ï¸ü
У¬JAVAеÄʼþÄ£ÐÍÓë¾ÉµÄJDKÄ£ÐÍÒ²ÓÐÁ˱¾ÖʵÄÇø±ð£¬ËüµÄʼþÄ£ÐÍÒ²ÓÐÁ˺ܴóµÄÇø±ð¡£ÓÉÓÚÏÖÔڵıà³Ì¶¼ÊDzÉÓÃʼþÇý¶¯£¬ËùÒÔºÜÓбØÒªÁ˽âµÄʼþÄ£
ÐÍ£¬ÎÒÃÇÏÂÃæ´Ó¶¨ÖÆʼþµÄʵ¼Ê³ö·¢À´¾ßÌåÌÖÂÛ¡£
ÎÊÌâµÄÌá³ö
......
1:¿¼ÂÇʹÓþ²Ì¬¹¤³§·½·¨´úÌæ¹¹¹¹·½·¨À´ÊµÀý»¯Àà¡£
2£ºÊ¹ÓÃ˽Óù¹¹¹º¯Êý£¬Ê¹Àà¾ßÓв»¿ÉʵÀý»¯µÄÄÜÁ¦¡£
3£º±ÜÃâ´´½¨Öظ´µÄ¶ÔÏó
4£ºÏû³ý¹ýÆڵĶÔÏóµÄʹÓÃ
5£º±ÜÃâʹÓÃÖսắÊý
6£ºÊ¹ÀàºÍ³ÉÔ±µÄ¿É·ÃÎÊÐÔ×îС
7£º½Ó¿ÚÓÅÏÈÓÚ³éÏó
8£ºÎªËùÓеIJÎÊý½øÐÐÓÐЧÐÔ¼ì²é
9£º½÷É÷ʹÓÃÖØÔØ
10£ºÊ¹ÓÃ0³¤¶ÈµÄÊý×飬¶ø²»ÊÇ¿Õ
11£º½«¾ ......