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

JVMÐéÄâ»ú»ù´¡£ºJava¶ÔÏó´óСÓëÀàÐÍÏê½â

»ù±¾Êý¾ÝµÄÀàÐ͵ĴóСÊǹ̶¨µÄ£¬ÕâÀï¾Í²»¶à˵ÁË¡£¶ÔÓÚ·Ç»ù±¾ÀàÐ͵ÄJava¶ÔÏó£¬Æä´óС¾ÍÖµµÃÉÌȶ¡£
ÔÚJavaÖУ¬Ò»¸ö¿ÕObject¶ÔÏóµÄ´óСÊÇ8byte£¬Õâ¸ö´óСֻÊDZ£´æ¶ÑÖÐÒ»¸öûÓÐÈκÎÊôÐԵĶÔÏóµÄ´óС¡£¿´ÏÂÃæÓï¾ä£º
Object ob = new Object(); 
ÕâÑùÔÚ³ÌÐòÖÐÍê³ÉÁËÒ»¸öJava¶ÔÏóµÄÉúÃü£¬µ«ÊÇËüËùÕ¼µÄ¿Õ¼äΪ£º4byte+8byte¡£4byteÊÇÉÏÃ沿·ÖËù˵µÄJavaÕ»Öб£´æÒýÓõÄËùÐèÒªµÄ¿Õ¼ä¡£¶øÄÇ8byteÔòÊÇJava¶ÑÖжÔÏóµÄÐÅÏ¢¡£ÒòΪËùÓеÄJava·Ç»ù±¾ÀàÐ͵ĶÔÏó¶¼ÐèҪĬÈϼ̳ÐObject¶ÔÏó£¬Òò´Ë²»ÂÛʲôÑùµÄJava¶ÔÏó£¬Æä´óС¶¼±ØÐëÊÇ´óÓÚ8byte¡£
ÓÐÁËObject¶ÔÏóµÄ´óС£¬ÎÒÃǾͿÉÒÔ¼ÆËãÆäËû¶ÔÏóµÄ´óСÁË¡£
Class NewObject {  int count;  boolean flag;  Object ob;  } 
Æä´óСΪ£º¿Õ¶ÔÏó´óС(8byte)+int´óС(4byte)+Boolean´óС(1byte)+¿ÕObjectÒýÓõĴóС(4byte)=17byte¡£µ«ÊÇÒòΪJavaÔÚ¶Ô¶ÔÏóÄÚ´æ·ÖÅäʱ¶¼ÊÇÒÔ8µÄÕûÊý±¶À´·Ö£¬Òò´Ë´óÓÚ17byteµÄ×î½Ó½ü8µÄÕûÊý±¶µÄÊÇ24£¬Òò´Ë´Ë¶ÔÏóµÄ´óСΪ24byte¡£
 
ÕâÀïÐèҪעÒâһϻù±¾ÀàÐ͵İü×°ÀàÐ͵ĴóС¡£ÒòΪÕâÖÖ°ü×°ÀàÐÍÒѾ­³ÉΪ¶ÔÏóÁË£¬Òò´ËÐèÒª°ÑËûÃÇ×÷Ϊ¶ÔÏóÀ´¿´´ý¡£°ü×°ÀàÐ͵ĴóСÖÁÉÙÊÇ12byte£¨ÉùÃ÷Ò»¸ö¿ÕObjectÖÁÉÙÐèÒªµÄ¿Õ¼ä£©£¬¶øÇÒ12byteûÓаüº¬ÈκÎÓÐЧÐÅÏ¢£¬Í¬Ê±£¬ÒòΪJava¶ÔÏó´óСÊÇ8µÄÕûÊý±¶£¬Òò´ËÒ»¸ö»ù±¾ÀàÐÍ°ü×°ÀàµÄ´óСÖÁÉÙÊÇ16byte¡£Õâ¸öÄÚ´æÕ¼ÓÃÊǺֲܿÀµÄ£¬ËüÊÇʹÓûù±¾ÀàÐ͵ÄN±¶£¨N>2£©£¬ÓÐЩÀàÐ͵ÄÄÚ´æÕ¼ÓøüÊÇ¿äÕÅ£¨Ëæ±ãÏëϾÍÖªµÀÁË£©¡£Òò´Ë£¬¿ÉÄܵĻ°Ó¦¾¡Á¿ÉÙʹÓðü×°Àà¡£ÔÚJDK5.0ÒÔºó£¬ÒòΪ¼ÓÈëÁË×Ô¶¯ÀàÐÍ×°»»£¬Òò´Ë£¬JavaÐéÄâ»ú»áÔÚ´æ´¢·½Ãæ½øÐÐÏàÓ¦µÄÓÅ»¯¡£
ÒýÓÃÀàÐÍ
¶ÔÏóÒýÓÃÀàÐÍ·ÖΪǿÒýÓá¢ÈíÒýÓá¢ÈõÒýÓúÍÐéÒýÓá£
Ç¿ÒýÓÃ:¾ÍÊÇÎÒÃÇÒ»°ãÉùÃ÷¶ÔÏóÊÇʱÐéÄâ»úÉú³ÉµÄÒýÓã¬Ç¿ÒýÓû·¾³Ï£¬À¬»ø»ØÊÕʱÐèÒªÑϸñÅжϵ±Ç°¶ÔÏóÊÇ·ñ±»Ç¿ÒýÓã¬Èç¹û±»Ç¿ÒýÓã¬Ôò²»»á±»À¬»ø»ØÊÕ
ÈíÒýÓÃ:ÈíÒýÓÃÒ»°ã±»×öΪ»º´æÀ´Ê¹Óá£ÓëÇ¿ÒýÓõÄÇø±ðÊÇ£¬ÈíÒýÓÃÔÚÀ¬»ø»ØÊÕʱ£¬ÐéÄâ»ú»á¸ù¾Ýµ±Ç°ÏµÍ³µÄÊ£ÓàÄÚ´æÀ´¾ö¶¨ÊÇ·ñ¶ÔÈíÒýÓýøÐлØÊÕ¡£Èç¹ûÊ£ÓàÄÚ´æ±È½Ï½ôÕÅ£¬ÔòÐéÄâ»ú»á»ØÊÕÈíÒýÓÃËùÒýÓõĿռ䣻Èç¹ûÊ£ÓàÄÚ´æÏà¶Ô¸»Ô££¬Ôò²»»á½øÐлØÊÕ¡£»»¾ä»°Ëµ£¬ÐéÄâ»úÔÚ·¢ÉúOutOfMemoryʱ£¬¿Ï¶¨ÊÇûÓÐÈíÒýÓôæÔڵġ£
ÈõÒýÓÃ:ÈõÒýÓÃÓëÈíÒýÓÃÀàËÆ£¬¶¼ÊÇ×÷Ϊ»º´æÀ´Ê¹Óᣵ«ÓëÈíÒýÓò»Í¬£¬ÈõÒýÓÃÔÚ½øÐÐÀ¬»ø»ØÊÕʱ£¬ÊÇÒ»¶¨»á±»»ØÊÕµôµÄ£¬Ò


Ïà¹ØÎĵµ£º

javaÖÐmap¼¯ºÏµÄÓ÷¨

1.ÉùÃ÷Ò»¸ömap: Map map = new HashMap();
2.ÏòmapÖзÅÖµ,×¢Ò⣺mapÊÇkey-valueµÄÐÎʽ´æ·ÅµÄ.Èç:
     map.put("sa","dd");
3.´ÓmapÖÐÈ¡Öµ:String str = map.get("sa").toString();½á¹ûÊÇ:str = "dd";
4.±éÀúÒ»¸ömap£¬´ÓÖÐÈ¡µÃkey ºÍvalue
JDK1.5
Map m = new HashMap();
for ( ......

JPetStore 5.0(iBATIS for java)ÖÐItem.xmlµÄbug

Caused by: java.sql.SQLException: ORA-00918: column ambiguously defined
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in com/ibatis/jpetstore/persistence/sqlmapdao/sql/Item.xml. 
--- The error occurred while applying a parameter map.&nbs ......

C++ÓëJavaµÄÇø±ðÏê½â:

1.JavaÔÚÐéÄâ»úÉÏÔËÐР
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·­Òë³ÉΪÐéÄâ»ú¿ÉÒÔÖ´ÐеĴúÂë¡£Ò»¸öJava½âÊÍÆ÷×îÖÕÖ´ÐÐÕâЩ´úÂë¡£ÕâÆäÖÐûÓÐÁ¬½ÓµÄ¹ý³Ì£»½âÊÍÔÚÐèÒªµÄʱºò¶¯Ì¬µÄ¼ÓÔØһЩÀࣻ 
2.JavaÊÇÍêÈ«ÃæÏò¶ÔÏóµÄ 
JavaÊÇÒ»ÖÖÍêÈ«ÃæÏò¶ÔÏóµÄÓïÑÔ¡£ÕâÒâζ×ÅÄã¶ÔÈκÎÒ»¸öJava¶ÔÏóËù×öµÄ¶ ......

java ¼ÆʱÆ÷

class NewTask extends java.util.TimerTask{
   private  String HOUR_MASK = "0";
      private String MIN_MASK = "0";
      private String SEC_MASK = "0";
      private int hour;
   private int min ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ