当前位置:网站首页>2:第一章:认识JVM规范1:JVM简介;
2:第一章:认识JVM规范1:JVM简介;
2022-07-05 22:53:00 【小枯林】
说明:
(1)JVM简介,认识JVM;
目录
1.JVM概述;
(1)虚拟机可以看成是一个计算机系统,只是它是有软件模拟的;
(2)在真实物理机上,主要是由CPU执行指令集;;;在JVM中,通过软件模拟指令集;
……………………………………………………
(1)右边部分:我们编写了java源代码(.java文件),然后通过java编译器(如javac等命令,或者通过IDEA等工具)把其编译成java字节码(.class文件);
● 这个过程就是开发过程;
(2)左边部分:当我们编译成.class文件后,这个Java平台运行期环境(即JVM)会通过类装载器(Class Loader),把字节码文件(.class文件)装载到虚拟机中去;
● 自然,装载的时候,会对字节码文件进行校验和认证(比如,校验是否符合虚拟机规范、格式是否正确等);
● 在装载字节码文件的时候,还会装载java类库(指那些必须要由虚拟机体提供的一些基本的、必要的支撑,比如:基本的数据类型、if-else和for循环的处理、基本的java安全的处理,JNI跟一些硬件的处理等等);
(3)左边中间部分:当我们装载完成后,虚拟机就会把这些交给Java解释器;
● Java解释器就会去解释字节码并执行;其中也会涉及即时编译器(JIT);
● 运行期比这个图中展示的要复杂的多;;;运行环境首先要做内存分配,然后执行.class字节码(就会用到字节码执行引擎),也需要垃圾回收,考虑并发处理,安全处理;
(4)左边下部分:如果需要和硬件或者操作系统交互的话(比如通过JNI与外界交互),就会出虚拟机了;即java程序和虚拟机交互、虚拟机和操作系统交互、然后通过操作系统与硬件交互;
2.JVM主要功能;
3.虚拟机是“Java平台无关性”的保障;
(1)在Windows系统上、Linux系统上等不同系统上,Java虚拟机是不同的;
(2)我们开发的同一套程序,把其编译成.class文件后;
● 把它扔到Linux系统上,就有Linux版的JVM去运行;;;把它扔到Windows系统上,就有Windows版的JVM去运行;
● 这样一看,其实Java并不是真的与平台无关;只不过我们不同平台上的不同的虚拟机帮我们屏蔽了而已;
边栏推荐
- The maximum happiness of the party
- Paddle Serving v0.9.0 重磅发布多机多卡分布式推理框架
- I closed the open source project alinesno cloud service
- npm ELECTRON_ Mirror is set as domestic source (npmmirror China mirror)
- Exponential weighted average and its deviation elimination
- Nail error code Encyclopedia
- audiopolicy
- Spectrum analysis of ADC sampling sequence based on stm32
- Tensor attribute statistics
- Ieventsystemhandler event interface
猜你喜欢

Element operation and element waiting in Web Automation
![[speech processing] speech signal denoising and denoising based on Matlab GUI low-pass filter [including Matlab source code 1708]](/img/df/9aa83ac5bd9f614942310a040a6dff.jpg)
[speech processing] speech signal denoising and denoising based on Matlab GUI low-pass filter [including Matlab source code 1708]

Metasploit (MSF) uses MS17_ 010 (eternal blue) encoding:: undefined conversionerror problem

TypeError: this. getOptions is not a function

Selenium+Pytest自动化测试框架实战

Sum of two numbers, sum of three numbers (sort + double pointer)

Masked Autoencoders Are Scalable Vision Learners (MAE)

Data type, variable declaration, global variable and i/o mapping of PLC programming basis (CoDeSys)

VOT toolkit environment configuration and use

一文搞定class的微观结构和指令
随机推荐
Metasploit (MSF) uses MS17_ 010 (eternal blue) encoding:: undefined conversionerror problem
数据库基础知识(面试)
[untitled]
CJ mccullem autograph: to dear Portland
如何快速理解复杂业务,系统思考问题?
audiopolicy
First, redis summarizes the installation types
[speech processing] speech signal denoising and denoising based on MATLAB low-pass filter [including Matlab source code 1709]
第十七周作业
Sum of two numbers, sum of three numbers (sort + double pointer)
Basic knowledge of database (interview)
Three.JS VR看房
Hcip day 11 (BGP agreement)
Exponential weighted average and its deviation elimination
TypeError: this. getOptions is not a function
VOT toolkit environment configuration and use
Déterminer si un arbre binaire est un arbre binaire complet
一文搞定JVM的内存结构
透彻理解JVM类加载子系统
February 13, 2022 -5- maximum depth of binary tree



