Java Virtual Machine (JVM) – Everything About It!

Web Design & Development

Java Virtual Machine (JVM) – Everything About It!

No Comments
Table of Content show
Read Time: 3 minutes

JVM or Java Virtual Machine is an abstract platform-dependent virtual machine used by many JAVA Development Companies which provides a runtime environment in which java bytecode can be well-executed.

It is available for various hardware and software platforms and has a major role in carrying out modern-day innovations.

JVM
JVM – Effective And Efficient

Function of a JVM

As discussed above it involves processes running on a machine, something similar to a server, which represents and controls the resource usage for a Java application. It, thus, basically performs 2 primordial functions – one, it works on the principle of “Write Once, Run Anywhere”, enabling the users to execute Java programs on nearly all devices and/or operating systems, and second, it optimizes and manages the program memory via a process known as Garbage Collection.

Besides, JVM also does tasks like loading the code, verifying it, executing it, and providing a suitable runtime environment to work efficiently. Not only this, but it also provides several definitions for different domains like class file format, register set, memory area, garbage-collected heap, fatal error reporting, etc..

Garbage Collection

JVM
JVM Garbage Collection

It is a major process running within a JVM which involves continuous identification and removal of the memory which is currently not being put to use in a Java program and/or application.

Architecture of a JVM

It consists of various technically associated domains like:-

1. Classloader

Classloader is a subpart of JVM being used to load the class files. Whenever a java program is run, it is first loaded by the classloader and then accordingly executed. There are primarily three built-in internal classloaders in Java. However, others can also be created on the same lines. The 3 in-built classloaders include:-

A. Bootstrap ClassLoader

It is the first classloader which is a superclass of the Extension classloader works to loads the jar files,                    containing all class files of Java Standard Edition like java.net package classes, java.io package classes, java.util          package classes, java.sql package classes, java.lang package classes etc…

B. Extension ClassLoader

This is a child classloader of the above mentioned and the parent classloader of the System classloader. It is           responsible for loading the jar files located within $JAVA_HOME/JRE/lib/ext

C. System/Application ClassLoader

It is the child classloader of the above and deals with loading the class files from classpath.

JVM
JVM Architecture

2. Class (Method) Area

Class (Method) Area stores per-class structures such as the field and method data, the runtime constant pool, the code for methods, etc…

3. Heap

It refers to the runtime data area where the allocation of objects takes place.

4. Stack

Storing of frames takes place, Java Stack. It holds local variables and partial results, thus playing an important part in the process of method invocation and return. Every thread has a private JVM stack which is created simultaneously along with the thread.

*A new frame is developed each time a method is invoked and is destroyed when the process of method invocation finishes.

5. Program Counter Register (PC)

PC (program counter) register has the address of the JVM instruction being executed currently.

6. Native Method Stack

It comprises of all the native methods being used in a program and/or an application.

7. Execution Engine

It includes: –

A. A virtual processor

B. Interpreter

Executes the instructions reading the byte code stream.

C. Just-In-Time(JIT) compiler:

It is used as a tool to enhance the performance of a JVM and is responsible for compiling the parts of the                  bytecode that have similar functionalities at the same time, hence reducing the time required for the                        completion of the compilation process.

D. Java Native Interface:

Java Native Interface (JNI) is a framework providing a communication interface such that it can communicate            with other applications other languages like C, C++, Assembly, etc. It is thus, also used to send output to the            Console or interact with the OS libraries.

Working of a JVM 

JVM
Java Virtual Machine (JVM)

1. Loading

It refers to the cation of loading a/the file on the memory using the classloaders and then representing it in the heap memory.

2. Linking

It is a 3 fold process, involving –

  • Verification:

Ensures the correctness of .classfile, checking whether the file is formatted properly and whether or not is generated by a valid compiler. If verification fails, a run-time exception java.lang.VerifyError is given.

  • Preparation:

Allocates memory for class variables and initializes it to the default values.

  • Resolution:

Replaces symbolic references with direct references, by searching into the method area so as to locate the              entity being referred to.

3. Initialization

Under this process, all the static variables are assigned their respective values as defined in the code and/or static blocks (if any), which is executed from top to bottom in a class and from parent to child in the class hierarchy.

 

Why to use OpenCart Website Development platform for Ecommerce?

Previous Post
How To Build An Efficient SharePoint Intranet Portal Marketing Plan
Next Post
7 Essential Points When Choosing An Offshore .NET Development Company

Related Posts

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
wpDiscuz
0
Would love your thoughts, please comment. x
()
x
| Reply

深圳SEO优化公司白城网站设计模板报价晋城外贸网站设计推荐铜仁网页制作哪家好迪庆seo林芝SEO按效果付费多少钱郴州至尊标王公司九江企业网站建设多少钱安庆SEO按天扣费多少钱遂宁阿里店铺托管价格福永SEO按天收费推荐布吉关键词按天扣费多少钱坪山外贸网站设计价格汕尾网站推广公司和县百度标王价格吕梁模板网站建设报价黔南优化价格黄冈网站开发推荐塔城网站搜索优化哪家好鄂州seo网站优化多少钱银川推广网站推荐鹤壁百姓网标王推荐南澳设计网站阿里seo排名多少钱衡阳关键词按天计费价格南昌建网站多少钱来宾网站推广系统哪家好宁德外贸网站制作临沂阿里店铺运营报价飞来峡建站多少钱玉林百度关键词包年推广歼20紧急升空逼退外机英媒称团队夜以继日筹划王妃复出草木蔓发 春山在望成都发生巨响 当地回应60岁老人炒菠菜未焯水致肾病恶化男子涉嫌走私被判11年却一天牢没坐劳斯莱斯右转逼停直行车网传落水者说“没让你救”系谣言广东通报13岁男孩性侵女童不予立案贵州小伙回应在美国卖三蹦子火了淀粉肠小王子日销售额涨超10倍有个姐真把千机伞做出来了近3万元金手镯仅含足金十克呼北高速交通事故已致14人死亡杨洋拄拐现身医院国产伟哥去年销售近13亿男子给前妻转账 现任妻子起诉要回新基金只募集到26元还是员工自购男孩疑遭霸凌 家长讨说法被踢出群充个话费竟沦为间接洗钱工具新的一天从800个哈欠开始单亲妈妈陷入热恋 14岁儿子报警#春分立蛋大挑战#中国投资客涌入日本东京买房两大学生合买彩票中奖一人不认账新加坡主帅:唯一目标击败中国队月嫂回应掌掴婴儿是在赶虫子19岁小伙救下5人后溺亡 多方发声清明节放假3天调休1天张家界的山上“长”满了韩国人?开封王婆为何火了主播靠辱骂母亲走红被批捕封号代拍被何赛飞拿着魔杖追着打阿根廷将发行1万与2万面值的纸币库克现身上海为江西彩礼“减负”的“试婚人”因自嘲式简历走红的教授更新简介殡仪馆花卉高于市场价3倍还重复用网友称在豆瓣酱里吃出老鼠头315晚会后胖东来又人满为患了网友建议重庆地铁不准乘客携带菜筐特朗普谈“凯特王妃P图照”罗斯否认插足凯特王妃婚姻青海通报栏杆断裂小学生跌落住进ICU恒大被罚41.75亿到底怎么缴湖南一县政协主席疑涉刑案被控制茶百道就改标签日期致歉王树国3次鞠躬告别西交大师生张立群任西安交通大学校长杨倩无缘巴黎奥运

深圳SEO优化公司 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化