日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > java >内容正文

java

Java overview JVM

發(fā)布時間:2024/1/17 java 48 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Java overview JVM 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

參考:?

http://www.cnblogs.com/java-chl/p/5614940.html

http://www.studytonight.com/java/component-of-java.php

?

JVM 生命周期

程序開始執(zhí)行它才運行,程序結(jié)束時它就停止。一臺機器上運行幾個程序就有幾個JVM, JVM的生成開始于一個main() 方法. main() 方法是程序的起點

它被執(zhí)行的線程初始化為程序的初始線程.程序中其他的線程都是有它來啟動.

JAVA中的線程分為兩種:守護(hù)線程(daemon) 和 普通線程(non-daemon). 守護(hù)線程是JVM自己使用的線程,比如負(fù)責(zé)垃圾收集的線程就是一個守護(hù)線程。

包含 main() 方法的線程是普通線程,只要JVM中還有普通的線程在執(zhí)行,JVM就不會停止。

?

?

?

?

?

classLoader: loads the class for execution:

method area: stores pre-class structure as constant pool.

heap: in which objects are allocated

stack: local variables and partial results are stores here. ?Each thread has a private JVM stack created when the thread is created.

program register: program register holds the address of JVM instruction currently being executed

native method stack: it contains all native used in application.

execution engine: controls the execute of instructions contained in the methods of the classes

native method interface: gives an interface between java code and native code during execution

native method libraries: consist of files required for the execution of native code

?

method area 和 heap是整個程序共享的,JVM加載并解析一個類以后,將從文件中解析出來的信息保存在 method area中,程序創(chuàng)建的object

都保存在heap 中

?

當(dāng)一個線程被創(chuàng)建時,會被分配屬于他自己的 pc register 和 stack,當(dāng)線程不調(diào)用本地方法時,pc register中保存線程執(zhí)行的下一條指令

stack保存了一個線程調(diào)用方法時的狀態(tài),包括本地變量,調(diào)用方法的參數(shù),返回值,處理的中間變量,調(diào)用本地方法時的狀態(tài)保存在 native method stack

?

?

?

Difference between JDK and JRE

JRE: The Java Runtime Environment provides the libraires, the JVM, and other components to run applets and applications written in JAVA. JRE does not contain tools and utilities such as compliers or debuggers for developing applets and applications

?

?

JDK: The JDK development kit is a super set of the JRE, and contains everything that is in the JRE, plus tools as te compilers and?

debuggers necessary for developing applets and applications

?

轉(zhuǎn)載于:https://www.cnblogs.com/morningdew/p/5617679.html

總結(jié)

以上是生活随笔為你收集整理的Java overview JVM的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。