????????????????????????????棬??????CPU??????????????????????????????????????????棬?????CPU???????л????????д?????????????浽??棬????????????????????е???????flush????????JVM??????????????????JVM?????????????????????????????os???е??????????????????e????????????????????

????JVM???????????????????6?????????洢???????????????????Heap??????6???????????£?

JVM????????????

???????潫????????????????????????????????????

????PC Register??PC???????

????PC???????????С??????????????????????????????е????????к???????????????????????????????????????????????????????????????κη???????????????????ж???????????????????????????????????????????????????

????????Java??????????????????????л???????????????????????????κ??????????????????????????????????????????е???????????????????????????????λ????У??????????????????????????????????????????к????????????????????????????????????“??????”????檔

??????????????????native?????PC??????в??洢?κ??????

?????? JVM?

????JVM????????е?????????????????????JVM???JVM??д???????????о????????????????java?ж???????????????boolean??char??byte??short??int??long??float??double?????????????????Stack Frame?????????????????JVM????????????????????????Java?л????????????????????????????????????????????Sun JDK???????JVM????????????????????????????????????

????????JVM????????е?????????????????????Ч????????????????????Щ??????????????

??????JVM???????????????StackOverflowError???????Sun JDK?п??????-Xss?????????С?????????′???
new Thread(new Runnable(){
           public void run() {
              loop(0);
           }       
           private void loop (int i){
              if(i!=1000){
                  i++;
loop (i);
              }
              else{
                  return;
              }
           }
          }).start();

??????JVM?????????-Xss1K?????к????????????????

????Exception in thread "Thread-0"java.lang.StackOverflowError

?????? ???Heap??

????Heap??????????????????JVM?????洢????????????????????????????Java?????????new????????????涼??????Heap?е??????????????GC???л????Heap??32λ???????????2G????64λ??????????????????????С???-Xms??-Xmx???????-Xms?JVM?????????СHeap??棬????????????1/64??С??1G??-Xmx?JVM????????Heap??棬????????????1/4??????????????С??40%???JVM??????Heap???С??-Xmx??????С???????-XX??MinHeapFreeRatio=???????????????????????????70%???JVM??Heap???С??-Xms??????С???????????-XX??MaxHeapFreeRatio=??????????????????????????????????????????Heap Size???С?????????-Xms??-Xmx?????????????????????????????????????????????????jvm?ж?????????????á????????????и????????????????????JVM?????????н???????????

???????????????????泬??????????С????????OutOfMemory??????????