JavaÄÚ´æÒç³öµÄÏêϸ½â¾ö·½°¸(ת)
±¾ÎĽéÉÜÁËJavaÄÚ´æÒç³öµÄÏêϸ½â¾ö·½°¸¡£±¾ÎÄ×ܽáÄÚ´æÒç³öÖ÷ÒªÓÐÁ½ÖÖÇé¿ö£¬¶øJVM¾³£µ÷ÓÃÀ¬»ø»ØÊÕÆ÷½â¾öÄÚ´æ¶Ñ²»×ãµÄÎÊÌ⣬µ«ÊÇÓÐʱÈÔ»áÓÐÄÚ´æ²»×ãµÄ´íÎó¡£×÷Õß·ÖÎöÁËJVMÄÚ´æÇøÓò×é³É¼°JVMÉèÖÃÐéÄâÄÚ´æµÄ·½Ê½£¬´Ó¶ø¸ø³öÁËһϵÁнâ¾ö·½°¸¡£ Ò»¡¢ÄÚ´æÒç³öÀàÐÍ 1¡¢java.lang.OutOfMemoryError: PermGen space JVM¹ÜÀíÁ½ÖÖÀàÐ͵ÄÄڴ棬¶ÑºÍ·Ç¶Ñ¡£¶ÑÊǸø¿ª·¢ÈËÔ±ÓõÄÉÏÃæ˵µÄ¾ÍÊÇ£¬ÊÇÔÚJVMÆô¶¯Ê±´´½¨£»·Ç¶ÑÊÇÁô¸øJVM×Ô¼ºÓõģ¬ÓÃÀ´´æ·ÅÀàµÄÐÅÏ¢µÄ¡£ËüºÍ¶Ñ²»Í¬£¬ÔËÐÐÆÚÄÚGC²»»áÊͷſռ䡣Èç¹ûweb appÓÃÁË´óÁ¿µÄµÚÈý·½jar»òÕßÓ¦ÓÃÓÐÌ«¶àµÄclassÎļþ¶øÇ¡ºÃMaxPermSizeÉèÖýÏС£¬³¬³öÁËÒ²»áµ¼ÖÂÕâ¿éÄÚ´æµÄÕ¼Óùý¶àÔì³ÉÒç³ö£¬»òÕßtomcatÈȲ¿Êðʱºî²»»áÇåÀíÇ°Ãæ¼ÓÔصĻ·¾³£¬Ö»»á½«context¸ü¸ÄΪв¿ÊðµÄ£¬·Ç¶Ñ´æµÄÄÚÈݾͻáÔ½À´Ô½¶à¡£ PermGen spaceµÄÈ«³ÆÊÇPermanent Generation space,ÊÇÖ¸ÄÚ´æµÄÓÀ¾Ã±£´æÇøÓò£¬Õâ¿éÄÚ´æÖ÷ÒªÊDZ»JVM´æ·ÅClassºÍMetaÐÅÏ¢µÄ,ClassÔÚ±»Loaderʱ¾Í»á±»·Åµ½PermGen spaceÖУ¬ËüºÍ´æ·ÅÀàʵÀý(Instance)µÄHeapÇøÓò²»Í¬,GC(Garbage Collection)²»»áÔÚÖ÷³ÌÐòÔËÐÐÆÚ¶ÔPermGen space½øÐÐÇåÀí£¬ËùÒÔÈç¹ûÄãµÄÓ¦ÓÃÖÐÓкÜCLASSµÄ»°,¾ÍºÜ¿ÉÄܳöÏÖPermGen space´íÎó£¬ÕâÖÖ´íÎó³£¼ûÔÚweb·þÎñÆ÷¶ÔJSP½øÐÐpre compileµÄʱºò¡£Èç¹ûÄãµÄWEB APP϶¼ÓÃÁË´óÁ¿µÄµÚÈý·½jar, Æä´óС³¬¹ýÁËjvmĬÈϵĴóС(4M)ÄÇô¾Í»á²úÉú´Ë´íÎóÐÅÏ¢ÁË¡£ Ò»¸ö×î¼ÑµÄÅäÖÃÀý×Ó£º(¾¹ý±¾ÈËÑéÖ¤£¬×Ô´ÓÓôËÅäÖÃÖ®ºó£¬ÔÙδ³öÏÖ¹ýtomcatËÀµôµÄÇé¿ö) set JAVA_OPTS=-Xms800m -Xmx800m -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=256m 2¡¢java.lang.OutOfMemoryError: Java heap space µÚÒ»ÖÖÇé¿öÊǸö²¹³ä£¬Ö÷Òª´æÔÚÎÊÌâ¾ÍÊdzöÏÖÔÚÕâ¸öÇé¿öÖС£ÆäĬÈÏ¿Õ¼ä(¼´-Xms)ÊÇÎïÀíÄÚ´æµÄ1/64£¬×î´ó¿Õ¼ä(-Xmx)ÊÇÎïÀíÄÚ´æµÄ1/4¡£Èç¹ûÄÚ´æÊ£Ó಻µ½40£¥£¬JVM¾Í»áÔö´ó¶Ñµ½XmxÉèÖõÄÖµ£¬ÄÚ´æÊ£Ó೬¹ý70£¥£¬JVM¾Í»á¼õС¶Ñµ½XmsÉèÖõÄÖµ¡£ËùÒÔ·þÎñÆ÷µÄXmxºÍXmsÉèÖÃÒ»°ãÓ¦¸ÃÉèÖÃÏàͬ±ÜÃâÿ´ÎGCºó¶¼Òªµ÷ÕûÐéÄâ»ú¶ÑµÄ´óС¡£¼ÙÉèÎïÀíÄÚ´æÎÞÏÞ´ó£¬ÄÇôJVMÄÚ´æµÄ×î´óÖµ¸ú²Ù×÷ϵͳÓйأ¬Ò»°ã32λ»úÊÇ1.5gµ½3gÖ®¼ä£¬¶ø64λµÄ¾Í²»»áÓÐÏÞÖÆÁË¡£ ×¢Ò⣺Èç¹ûXms³¬¹ýÁËXmxÖµ£¬»òÕ߶Ñ×î´óÖµºÍ·Ç¶Ñ×î´óÖµµÄ×ܺͳ¬¹ýÁËÎïÀíÄÚ´æ»òÕß²Ù×÷ϵͳµÄ×î´óÏÞÖƶ¼»áÒýÆð·þÎñÆ÷Æô¶¯²»ÆðÀ´¡£ À¬»ø»ØÊÕGCµÄ½ÇÉ« JVMµ÷ÓÃGCµÄƵ¶È»¹ÊǺܸߵģ¬Ö÷ÒªÁ½ÖÖÇé¿öϽøÐÐÀ¬»ø»ØÊÕ£º µ±Ó¦ÓóÌÐòÏ߳̿ÕÏУ»ÁíÒ»¸ö
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
C++ÓëJavaÒìͬ
1¡¢Ö¸Õë¡ï¡ï¡ï¡ï¡ï
C C++ÖеÄÖ¸Õ룬ÌṩÁ˺ܴóµÄÁé»îÐÔ£¬µ«ÊÇÁé»îÒ²´øÀ´ÁËΣÏÕ£¬¶ÔÖ¸Õë²Ù×÷µÄ²»µ±ÈÝÒ×Ôì³ÉÄÚ´æ鶻òÊÇ¿ÕÐüÖ¸ÕëµÈÎÊÌâ¡£
JavaÈ¡ÏûÁËÖ¸Õë¡£µ«Êµ¼ÊÉÏ£¬javaÖÐÉùÃ÷µÄËùÓÐÒýÓÃÊý¾ÝÀàÐ͵ÄÃû³Æ£¬¿ÉÒÔÀí½âΪ¾ÍÊÇÒ»¸öÖ¸Õë¡£¸ÃÃû³Æ´æ´¢ÔÚÕ»ÄÚ´æÉÏ£¬Ö¸Ïò¶ÔÄÚ´æÉÏʹÓÃnew¿ª±ÙµÄ¿Õ¼ä¡£
È磺
int[] ......
½ñÌìºÜ¸ßÐË¿´ÁËÕÅТÏéÀÏʦ½²µÄJava»ù´¡ÊÓƵ¡£
ÕÅÀÏʦÊ×ÏȽ²µÄÊÇfinal¡¢super¡¢this staticµÄÓ÷¨£¬ÕÅÀÏʦÊÇÕâÑù½²µÄ£¬ÎÒ×öÁËһЩ¼òµ¥µÄ¼Ç¼£º
1. ......
JAVAÖеÄÒÀÀµµ¹ÔÔò
ÃÀ¹ú·¨ÂÉÓÐÒ»Ìõ×î»ù±¾µÄ×¼Ôò¾ÍÊÇ“ÈËÈËƽµÈ”£¬ÎÒÃDz»È¥¹ÜËüÊǾ¹ýʲôÑùµÄ¶·Õù¡¢Ê²Ã´ÑùµÄÁ÷ѪÎþÉü»»À´µÄ£¬Ö»°ÑËüÀí½âΪһ¸öJAVA·½·¨£¬¸Ã·½·¨¶¨ÒåÈçÏ£º
public final boolean ÈËÈËƽµÈ(ÈË1£¬ÈË2){
return true;
&n ......
ÔÎÄ£ºDependency Injection in Java EE 6 – Part 1
×÷ÕߣºReza Rahman
³ö´¦£ºhttp://www.theserverside.com/tt/articles/article.tss?l=DependencyInjectioninJavaEE6
ÕâÒ»ÎÄÕÂϵÁнéÉÜÁËJava EEµÄÉÏÏÂÎĺÍÒÀÀµ×¢È루Contexts and Dependency Injection for Java EE£¬CDI£©£¬CDIÊǼ´½«Íê³ÉµÄJava EE 6Æ½Ì ......