JVM

基础知识:
JVM(Java Virtual Machine):在这里插入图片描述
JVM功能:

  1. Loading
  2. Linking
  3. Initialization
    在这里插入图片描述
JVM Memory

Method area :In method area, all class level information like class name, immediate parent class name, methods and variables information etc. are stored, including static variables. There is only one method area per JVM, and it is a shared resource. Key:shared. Only one per JVM

Heap area :Information of all objects is stored in heap area. There is also one Heap Area per JVM. It is also a shared resource. Key:shared. Only one per KVM

Stack area :For every thread, JVM create one run-time stack which is stored here. Every block of this stack is called activation record/stack frame which store methods calls. All local variables of that method are stored in their corresponding frame. After a thread terminate, it’s run-time stack will be destroyed by JVM. It is not a shared resource. Key:Per thread, current thread stack frame. eg. recusively on itself will cause stackOverFlow

PC Registers :Store address of current execution instruction of a thread. Obviously each thread has separate PC Registers.Key:Per thread, current thread next execute

Native method stacks :For every thread, separate native stack is created. It stores native method information Called from stack area.

**Execution Engine**

Execution engine execute the .class (bytecode). It reads the byte-code line by line, use data and information present in various memory area and execute instructions. It can be classified in three parts :-

Interpreter : It interprets the bytecode line by line and then executes. The disadvantage here is that when one method is called multiple times, every time interpretation is required.
Just-In-Time Compiler(JIT) : It is used to increase efficiency of interpreter.It compiles the entire bytecode and changes it to native code so whenever interpreter see repeated method calls,JIT provide direct native code for that part so re-interpretation is not required,thus efficiency is improved.
Garbage Collector : It destroy un-referenced objects.For more on Garbage Collector,refer Garbage Collector.

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值