Java????????????
???????????? ???????[ 2015/9/18 13:40:04 ] ??????????????????? ???
??????????????????????????C?????????????java????и????????????????java??????????????У???????????????????delete/free??棬????????????????????????
??????????????????java???????????????????????????鷳?????飬???????java???????????????????????????????????
????java????м???:?????????????????????????????????????????????????檔??????????????????????????????????
????1????????????????????С?????????????????????к?????????????????????????
????2?????????????????????????StackOverFlowError??????????????????????????????????????????
??????1??????????????jvm????????????????д?С???????????????????????????????????????StackOverFlowError(???У??????????С?????????????????????????????????????????????10000??????????????????л?????????????????????Щ??棬???????6000???????
???????????????????????
public class Main {
private int stackLength = 1;
public void stackLeak()
{
stackLength ++;
stackLeak();
}
public static void main(String[]args)
{
Main main = new Main();
try
{
main.stackLeak();
}
catch(Error e)
{
System.out.println("stack length:" + main.stackLength);
throw e;
}
}
}
????????????
????stack length:6745
????Exception in thread "main" java.lang.StackOverflowError
????at Main.stackLeak(Main.java:12)
????at Main.stackLeak(Main.java:13)
??????2???????????????????????????檔
????3?????????????????????????????? -XX:PermSize=3M -XX:MaxPermSize=3M ?????????м?????????????????????????й????? PermGen space.???????????????
?????????????????????????????jdk1.7??????汾?????String.intern()????????????????????????????????????????????????á?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11