当前位置:网站首页>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并不是真的与平台无关;只不过我们不同平台上的不同的虚拟机帮我们屏蔽了而已;
边栏推荐
- 3 find the greatest common divisor and the least common multiple
- Matlab smooth curve connection scatter diagram
- Basic knowledge of database (interview)
- VOT toolkit environment configuration and use
- 使用rewrite规则实现将所有到a域名的访问rewrite到b域名
- 30 optimization skills about mysql, super practical
- Global and Chinese markets for welding products 2022-2028: Research Report on technology, participants, trends, market size and share
- openresty ngx_lua正則錶達式
- Google Maps case
- Leetcode weekly The 280 game of the week is still difficult for the special game of the week's beauty team ~ simple simulation + hash parity count + sorting simulation traversal
猜你喜欢
一文搞定class的微观结构和指令
2022 registration examination for safety management personnel of hazardous chemical business units and simulated reexamination examination for safety management personnel of hazardous chemical busines
Unity Max and min constraint adjustment
Exponential weighted average and its deviation elimination
Negative sampling
My experience and summary of the new Zhongtai model
Event trigger requirements of the function called by the event trigger
并查集实践
东南亚电商指南,卖家如何布局东南亚市场?
Data type, variable declaration, global variable and i/o mapping of PLC programming basis (CoDeSys)
随机推荐
3 find the greatest common divisor and the least common multiple
Boring boring
First, redis summarizes the installation types
Hcip day 12 (BGP black hole, anti ring, configuration)
How to quickly understand complex businesses and systematically think about problems?
从 1.5 开始搭建一个微服务框架——日志追踪 traceId
Three.JS VR看房
Southeast Asia e-commerce guide, how do sellers layout the Southeast Asia market?
Global and Chinese market of diesel fire pump 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese markets of industrial pH meters 2022-2028: Research Report on technology, participants, trends, market size and share
Ultrasonic sensor flash | LEGO eV3 Teaching
Hj16 shopping list
leecode-学习笔记
实现反向代理客户端IP透传
Global and Chinese market of water treatment technology 2022-2028: Research Report on technology, participants, trends, market size and share
Activate function and its gradient
Selenium+Pytest自动化测试框架实战
Use of metadata in golang grpc
Douban scoring applet Part-2
Element operation and element waiting in Web Automation