ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

Java运行时数据区域详解

2021-06-20 18:32:27  阅读:160  来源: 互联网

标签:constant 区域 Utf8 详解 entry Java class points


JVM运行时数据区域(Run-Time Data Areas)包括以下几部分:

1.程序计数器(The PC Register)

2. Java虚拟机栈(Java Virtual Machine Stacks)

每一个JVM线程都有一个Java虚拟机栈,当线程被创建的时候该虚拟机栈就会被一起创建。虚拟机栈描述的是Java方法执行的内存模型:每个方法在执行的同时都会创建一个栈帧(Stack Frame)。每一个方法从调用直至执行完成的过程,就对应着一个栈帧在虚拟机栈中入栈到出栈的过程。栈帧存储的信息包括:

局部变量表(Local Variable Table)

操作数栈(Operand Stack)

动态链接(Dynamic Linking)

方法返回地址(Return Address)

3. Heap

Head用来在运行时分配class和arrays实例。class的实例只会被GC(Garbage Collector)回收。

Heap分为以下几个区域:

Young Generation(年轻代)

Old Generation(老生代)

Permanent Generation(永久代)

4. Method Area

5.运行时常量池(Run-Time Constant Pool)

运行时常量池(Runtime Constant Pool)包括:

numeric literals

string literals

class references

field references

method references

Constant Pool 包含以下的类型:

Integer

A 4 byte int constant

Long

An 8 byte long constant

Float

A 4 byte float constant

Double

A 8 byte double constant

String

A String constant that points at another Utf8 entry in the constant pool which contains the actual bytes

Utf8

A stream of bytes representing a Utf8 encoded sequence of characters

Class

A Class constant that points at another Utf8 entry in the constant pool which contains the fully qualified class name in the internal JVM format (this is used by the dynamic linking process)

NameAndType

A colon separated pair of values each pointing at other entries in the constant pool. The first value (before the colon) points at a Utf8 string entry that is the method or field name. The second value points at a Utf8 entry that represents the type, in the case of a field this is the fully qualified class name, in the case of a method this is a list of fully qualified class names one per parameter.

FieldRef,

MethodRef,

InterfaceMethodRef

A dot separated pair of values each pointing at other entries in the constant pool. The first value (before the dot) points at a Class entry. The second value points at a NameAndType entry.

 6. 本地方法栈(Native Method Stacks)

从Java 8起,Method Area被替换成MetaSpace.

标签:constant,区域,Utf8,详解,entry,Java,class,points
来源: https://www.cnblogs.com/xifengcoder/p/14907582.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有