Java????????????????
???????????? ???????[ 2015/1/19 11:11:58 ] ????????Java ???????
????????Щ??÷?????????????????????????????????????????????????????????????????????????class??б?ж????
?????????ó?????????漰????????????????????????????棨???-XX:PermSize??-XX:MaxPermSize??????????С????????????????????
?????Щ??????????????spring??hibernate???????????????????????CGLib????????Щ????????????????????????????????????洢????????Class?????
???????????Java??????????????????????е??String.intern()??????????е???????鳣????????????????????????????????????????????ж???????????????????????????????????????????????????????á??????????????String.intern????????????????????????????.??????????????μ?????????????????
????import java.util.*;
????import java.lang.*;
????public class OOMTest{
????public static void main(String... args){
????List<String> list = new ArrayList<String>();
????while(true){
????list.add(UUID.randomUUID().toString().intern());
????}
????}
????}
??????????????μ????????????????
????java -verbose:gc -Xmn5M -Xms10M -Xmx10M -XX:MaxPermSize=1M -XX:+PrintGC OOMTest
???????к??????????????:
????Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
????at java.lang.String.intern(Native Method)
????at OOMTest.main(OOMTest.java:8)
?????????????????????????????????????????????????????е?PermGen space????????????????????????????????????????????Hotspot jvm????????????????????????
????OutOfMemoryError:unable to create native thread
??????????????????java.lang.OutOfMemoryError:unable to create natvie thread??????? ???????????????????????????????????μ??
???????????????????????????????????????Linux??????????????ulimit -u???????????
?????????????????????????′???????????????native???????????????????????????????????????????????????Jvm???????????????????????????????????????4G????棬??????????????????????????????????????????????????檔 ????????????=4G-??-Xmx?????- ??-XX:MaxPermSize?????- ???????????????? ??????????????????????-Xmx ?? MaxPermSize????????????????????????С????-Xss???????????????????????£?????????????????С???????????????????????μ?unable to create native thread????????????????????????????棬???????-Xmx????-Xss????????????????????
??????
???·???
??????????????????
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