当前位置:网站首页>1. Introduction to JVM
1. Introduction to JVM
2022-07-06 17:14:00 【Smart popcorn】
1. learn JVM What is the purpose ?
Everyone should learn with purpose Rather than say He let me learn, I will learn
that Why did he let you learn ?
Well, no selling
Study JVM It can make us clear in Java Program execution process The method attribute Classes have a clearer understanding And it is also good for learning concurrency If we talk about actual combat That must be JVM Parameter tuning
Now You will no longer be a beginner Gradually move towards the big guy
When you are old , Looking back on life , Will find out : When to study abroad 、 When to decide on your first career 、 When you choose an object and fall in love 、 When to get married , In fact, it's all a big change of fate . Just standing at a fork in the road , See the wind and clouds and thousands of masts , The day you made your choice , In the diary , Quite dull and ordinary , I thought it was an ordinary day in my life .
For us learn JVM Just an ordinary day But it will lay a foundation for us in the future
2. Brief introduction JVM
Cross platform and cross language
jvm It is a cross language platform Now it supports multiple languages in jvm Up operation
let me put it another way java Platform language and jvm It's a cross language platform
simply our java Source file after javac command Translate it into .class file It is not implemented immediately But through jvm Translate it into machine language Finally implemented It's just that we can't perceive all this
virtual machine
Virtual machines are simply divided into two types System virtual machine and program virtual machine
The former can install an entire operating system Such as windows and linux The latter is designed for a single program The typical representative is jvm
It is necessary to draw a picture here to let you understand jvm Where it is 
Be careful jvm It does not interact directly with the hardware It runs on the operating system
3. JVM framework
The overall architecture
The overall structure is as follows Let's make an impression first You need to be able to draw later 
Architectural model
Java There are two main types of compiler instruction flow One is stack based One is register based
What's the difference between the two ?
Stack based architecture It's relatively easy to implement And does not need to rely on hardware That is to say, it can be used across platforms
Based on register architecture Depending on the hardware Poor portability
In order not to be limited by hardware , For greater cross platform , therefore java The compiler implementation adopts the stack architecture .
4. JVM Life cycle
JVM The boot class loader creates an initial class to complete the startup of , according to JVM Different implementations of , The definition of this class is different .
When running a java When it comes to programming , One JVM The process is really started , Program end ,JVM And then quit .
There are five situations that can cause JVM sign out , If you ask , Simply answer twoorthree kinds , Answer it all , There are some rolls , The interviewer may not be so clear .
- The program ends normally ,JVM sign out
- An exception causes the program to exit ,JVM And then quit
- Operating system errors cause JVM sign out
- call Runtime.hale() or System.exit() Lead to JVM sign out
- use JNI Invocation API uninstall JVM(C Language call )
5. JVM Historical development
1. The original virtual machine sun classic
This is the oldest virtual machine ,1996 year Sun The first commercial product developed by the company Java virtual machine , It realizes the combination of interpreter and compiler , Explain that it runs fast , High compilation efficiency , Combined use is better .
2. Absolute overlord HotSpot
Occupy absolute market position ,jdk1.3 in the future , Become openJdk and OracleJdk All by default JVM, It is worth mentioning that his hot code detection technology , Find the most valuable code through the counter and cache it , Increase of efficiency .
3. The second overlord JRocket
BEA The company developed the fastest JVM, This may be achieved on their own products , Focus on the server , All the code is compiled and executed by the compiler , Understanding can .
ps: The company was later Oracle Acquisition , stay HotSpot Graft on JRocket Excellent characteristics of .
4. The third overlord J9
IBM Developed by the company , Market position and HotSpot near .
5. Future overlord Grral VM
Really cross language stack JVM, Can be used on any platform , Future period , If one day you want to replace HotSpot, Then it must be the next successor .
边栏推荐
- Only learning C can live up to expectations top2 P1 variable
- The "advertising maniacs" in this group of programmers turned Tiktok advertisements into ar games
- Assembly language segment definition
- 这群程序员中的「广告狂人」,把抖音广告做成了AR游戏
- 汇编语言段定义
- Yum install XXX reports an error
- Fdog series (III): use Tencent cloud SMS interface to send SMS, write database, deploy to server, web finale.
- DOS function call
- Only learning C can live up to expectations Top1 environment configuration
- 8086 分段技术
猜你喜欢

Activiti目录(五)驳回、重新发起、取消流程

Description of project structure configuration of idea

Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?

Ruoyi-Cloud 踩坑的BUG

Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here

Fdog series (VI): use QT to communicate between the client and the client through the server (less information, recommended Collection)

Shell_ 04_ Shell script

Activiti directory (III) deployment process and initiation process

Set up the flutter environment pit collection

Idea resolving jar package conflicts
随机推荐
Log4j2 major vulnerabilities and Solutions
MySQL optimization notes
逻辑运算指令
ByteDance technical Interviewer: what kind of candidate do I want to pick most
On the clever use of stream and map
DS18B20數字溫度計系統設計
"One year after graduation, I won ACL best paper"
JS garbage collection mechanism and memory leakage
Introduction to spring trick of ByteDance: senior students, senior students, senior students, and the author "brocade bag"
原型链继承
8086 内存
吴军三部曲见识(四) 大家智慧
Assembly language addressing mode
mysql的列的数据类型详解
唯有学C不负众望 TOP3 Demo练习
koa中间件
SQL调优小记
arithmetic operation
Shell_ 05_ operator
Fdog series (III): use Tencent cloud SMS interface to send SMS, write database, deploy to server, web finale.