java.lang.OutOfMemoryError: Java heap space
ÎÊÌâÃèÊö
Exception in thread "main" java.lang.OutOfMemoryError:
Java heap space
½â¾ö·½°¸[ת]
Ò»Ö±¶¼ÖªµÀ¿ÉÒÔÉèÖÃjvm heap´óС£¬Ò»Ö±ÓÃeclipseд/µ÷ÊÔjava³ÌÐò¡£Ò»Ö±ÓÃÃüÁîÐÐor
console¼Ó²ÎÊýÅܳÌÐò¡£ÏÖÏó£ºÔÚeclipseµÄÅäÖÃÎļþeclipse.iniÖÐÉèÖÃ-vmargs -Xms500m
-Xmx1024m
£¬ÔÚeclipseÖÐÖ±½Órun
»òÕßdebugijЩºÄÄÚ´æµÄ³ÌÐòʱÒÀÈ»³öÏÖjava.lang.OutOfMemoryError: Java Heap
Space´íÎ󣬼´Í¨³£ÈÏΪµÄÄÚ´æ²»×㣬javaÐéÄâ»úÄÚ´æ²»¹»Ó᣶øÔÚÃüÁîÐмÓÕâЩ²ÎÊýÔòÓÐЧ¹û£¬²»»á³ö´í¡£Õâ˵Ã÷Ò»¸öÎÊÌ⣬
ÕâЩ²ÎÊý¸ù±¾Ã»ÓÐÆð×÷ÓÃ
¡£½ñÌìÐèÒªÔÚeclipseÀïµ÷ÊÔ³ÌÐò£¬»¹Ã»µ½ÐèÒªµ÷ÊԵĵط½¾Íheap
errorÁË£¬ÔÚÍøÉÏËÑÁ˺ܶàµØ·½£¬µÃµ½ÁË×îÖյĴ𰸣º
Ñ¡Öб»ÔËÐеÄÀ࣬µã»÷²Ëµ¥‘
run->run...
’£¬
Ñ¡Ôñ(x)=Argument±êǩҳϵÄvm arguments
¿ò
Àï
ÊäÈë -Xmx800m
, ±£´æÔËÐС£
ÔÀ´»¹ÐèÒª¶Ôÿ¸öprojectµ¥¶ÀÉèÖÃ
£¬º¹...
ÓÐÈýÖÖ¿ÉÄܵ¼ÖÂOutOfMemoryError¡£Ê×ÏÈÊÇ£¬´ËJVMÓÐÕæʵµÄÄÚ´æй©£¬µ¼Ö´ËJVM¶ÑÔÚÄÚ²¿ÊµÏÖʱ²úÉúÁËÒ»¸öBug¡£Õ⼫²»¿É¿¿¡£ËùÓÐ
JVM¶¼¾¹ý³ä·ÖµÄ²âÊÔ£¬²¢ÇÒ£¬Èç¹ûÓÐÈË·¢ÏÖÕâÖÖbug£¬Ëü½«¾ø¶ÔÊÇ×î¸ßµÄÓÅÏȼ¶¡£Òò´ËÄã¿ÉÒԷdz£¿íÐĵØÅųýÕâÖÖ¿ÉÄÜÐÔ¡£
µÚ¶þÖÖ¿ÉÄܵÄOutOfMemoryErrorÔÒòÖ»²»¹ýÊÇ£¬ÄãûÓÐΪÄãµÄÓ¦ÓóÌÐòÔËÐÐʱ¸øÓè×ã¹»¶àµÄ¿ÉÓÃÄÚ´æ¡£ÕâÖÖÇé¿ö£¬ÓÐÁ½ÖÖ¿ÉÄܵķ½°¸£¬»òÕßÔö¼Ó
JVM¶Ñ¿ÉÓôóС£¬»òÕß¼õÉÙÄãµÄÓ¦ÓóÌÐòËùÐèµÄÄÚ´æ×ÜÁ¿¡£Ìá¸ßJVM¿ÉÓöѴóС¿ÉÒÔ¼òµ¥µÄʹÓÃJVMµÄ -Xmx
²ÎÊý¡£¼ÙÈçÄ㽫´Ë²ÎÊýÉèÖþ¡¿ÉÄܵĴ󣨿ÉÓÃÄڴ漫ÏÞ²»Òª³¬¹ýϵͳÎïÀíÄڴ棬·ñÔòÄãµÄÓ¦ÓóÌÐò½«·ÖÒ³²¢ÔÝÍ££©£¬ÈÔÈ»ÓÐÒÔÉÏËùÌáµ½µÄÄÚ´æÎÊÌ⣬ÄÇô£¬ÄãÐèÒª¼õ
ÉÙÄãµÄÓ¦ÓóÌÐòËù¿ÉÄÜÓõ½ÄÚ´æ×ÜÁ¿¡£¼õÉÙÓ¦ÓóÌÐòÄÚ´æ¿ÉÄÜÊǼòµ¥µÄ£¬Äã¿ÉÄÜÔÊÐíһЩ¼¯ºÏ¹ý´ó£¬ÀýÈçʹÓÃÁËÐí¶à´óµÄ»º³åÇø¡£»òÕßËü¹ýÓÚ¸´ÔÓ£¬ÒªÇóÄãÖØÐÂʵÏÖ
һЩÀ࣬ÄËÖÁÖØÐÂÉè¼ÆÓ¦ÓóÌÐò¡£
¶ÁÕß Jams Stauffer Ö¸³öÓÐЩJVM£¨ÀýÈç sunµÄ
JVMs£©£¬»¹ÓÐÒ»¸ö“Perm”²ÎÊýÓÃÀ´´¦ÀíJVM½á¹¹ÓëÀà¶ÔÏó¡£Èç¹ûÄãÕýÔÚʹÓÃÒ»¸öÊýÁ¿·Ç³£¾Þ´óµÄÀ༯£¬ËüÓпÉÄÜÔËÐÐÔÚ"Perm"¿Õ¼äÖ®Í⣬ȻºóÄã
ÐèÒªÔö¼Ó´Ë¿Õ¼äµÄ´óС£¬ÀýÈ磬sunµÄJVMʹÓà -XX:PermSize Óë -XX:MaxPermSize Ñ¡Ïî¡£
µÚÈýÖÖµ¼ÖÂOutOfMemoryError×îΪ³£¼û£¬ÎÞÐĵĶÔÏóÒýÓñ£³Ö¡£ÄãûÓÐÃ÷È·ÎÞÎóµÄÊͷŶÔÏó£¬ÒÔÖÂ
Ïà¹ØÎĵµ£º
public class Fibonacci {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
NumOfFibonacci(9);
}
public static int MyFibonacci(int i){
if(i>0) {
if(i == 1)return 1;
if(i == 2)return 1;
else return MyFibonacc ......
JAVAµÄ¿çƽ̨µÄÌØÐÔÉîÊÜjava³ÌÐòÔ±ÃǵÄϲ°®,µ«ÕýÊÇÓÉÓÚËüΪÁËʵÏÖ¿çƽ̨µÄÄ¿µÄ,ʹµÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ,´ó´óÔ¼ÊøÁËËüµÄ¹¦ÄÜ,±ÈÈçÓëһЩӲ¼þÉ豸ͨÐÅ,ÍùÍùÒª»¨·ÑºÜ´óµÄ¾«Á¦È¥Éè¼ÆÁ÷³Ì±àд´úÂëÈ¥¹ÜÀíÉ豸¶Ë¿Ú,¶øÇÒÓÐһЩÉ豸³§ÉÌÌṩµÄÓ²¼þ½Ó¿ÚÒѾ¾¹ýÒ»¶¨µÄ·â×°ºÍ´¦Àí,²»ÄÜÖ±½ÓʹÓÃjava³ÌÐòͨ¹ý¶Ë¿Úº ......
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
ÔÚtomcatÖз¢²¼webÏîÄ¿£¬¿ÉÄÜÊÇÒòΪspringÖÐÅäÖÃÁËjndi£¨Ö»ÅäÖÃÁËjndi£¬ÆäËûµÄÓй¤¾ß°ü·â×°ÁË£©¡£
Æô¶¯µÄʱºò±¨´í£¨ÔÚÏîĿĿ¼Ï£¬ÔÚtomcatÖÐÅäÖÃcontextÖ¸ÏòÏîĿĿ¼¾ÍûÎÊÌ⣬´ò°ü·¢²¼µ½
tomcat¾Í±¨´íÁË£©£¬Å×µÄÒì³£ÊÇ£º
jav ......
http://www.gotapi.com/
ÓïÑÔ£ºÓ¢Óï
¼ò½é£ºHTML,CSS,XPATH,XSL,JAVASCRIPTµÈAPIµÄ²éѯÍøÕ¾¡£
http://www.w3schools.com/
ÓïÑÔ£ºÓ¢Óï
¼ò½é£ºW3CÖƶ¨µÄ±ê×¼ÖîÈçXML,HTML,XSLµÈµÈµÄÔÚÏßѧϰ½Ì³Ì¡£
http://www.xml.org.cn/
ÓïÑÔ£ºÖÐÎÄ
¼ò½é£º¿ÉÒÔ˵ÊÇXMLµÄÖйú¹Ù·½Íø°É¡£W3C ......
import java.net.URL;
import java.net.URLDecoder;
public class PathUtil
{
/**
* Get the env of windir, such as "C:\WINDOWS".
* @return the env of windir value.
*/
public static String getWindir(){
return System.getenv("windir");
}
......