当前位置:网站首页>虚拟机内存结构简述
虚拟机内存结构简述
2022-06-13 09:25:00 【edui】
这个虚拟机有好多个版本,其中最常用的是HotSpot,不晓得神情况下载就是这个版本。大致的内存模型入下图。
线程共享即为每个线程都用的同一个区域的内存,所有线程都可以自由访问。线程隔离即为线程独有的,线程之间不能共同访问。
方法区
这个区域的内存线程共享的,用于保存类的信息,常量,是堆的一个逻辑部分,所以垃圾回收也会回收到。静待变量等数据,1.7之前还存有字符串常量HotSpot1.7后转移到了堆,所以String.intern()查询虚拟机里是否有该字符串存在,方法不同的虚拟机可能表现不一样。在HotSpot中通常称为永久代,因为这部分内存也加入回收机制只是条件比较苛刻,堆
第一次看到的时候还以为和数据结构和算法里面的堆有点联系的,然而堆内存管理方式不是堆数据结构,通常是链表的形式。这个堆就是表现为一堆内存这样子而已。跟数据结构里堆毛关系没有。这块内存存放对象实列的,线程共享。通常所说的对象引用就是指向这个区域的。本地方法栈和Java虚拟机栈
这两个差不多一样,在有的虚拟机直接就是合二为一,这个区域线程私有的,每个方法在执行的同时都会创建一个栈帧(关于栈帧后面介绍),这个栈帧用于存储局部变量表、操作数栈、动态链接、方法出口等信息,每个方法从调用直至执行完成的过程,就对应着一个栈帧在虚拟机栈中入栈到出栈的过程。本地方法为Java方法服务,Java虚拟机方法为native方法服务(可能是其他语言的方法)程序计数器
线程私有的,保存程序运行的位置(指令地址),指哪执行哪,先改变计数器的值再执行所指的代码。
边栏推荐
- Zigzag transformation
- SQL ROW_ The number() function uses
- Jenkins接入Openldap用户认证
- Class and object -- friend
- (bfs+GOOD) acwing 845. Eight digit
- (dfs+ tree DP) acwing 846 Center of gravity of tree
- [implementation of depth first search]
- Acwing785. quick sort (sort+ quick sort + merge sort)
- C # introductory series (XIII) -- getting to know the structure for the first time
- 1-2 24:00 (20 points) [CSP certification true question]
猜你喜欢

Learning makefile with me
![[51nod p3047] displacement operation [bit operation]](/img/89/065e59382d3596868002466e3951d9.jpg)
[51nod p3047] displacement operation [bit operation]
![1-2 24:00 (20 points) [CSP certification true question]](/img/3b/fe2c0e46dca604e5906d9c5ceabbe3.jpg)
1-2 24:00 (20 points) [CSP certification true question]

Consolas-with-Yahei

Heap
![[51nod 3062] n queen problem V2 [bit operation DFS]](/img/ca/4e3b01c371557d8214da6a97eba3ac.jpg)
[51nod 3062] n queen problem V2 [bit operation DFS]

VGA常用分辨率及计算方法

(dp+ memory) acwing 901 skiing

(dfs+ pruning + checkerboard problem +dood) acwing 843 N-queen problem

turtle库显示系统时间
随机推荐
【最全面详细解释】背包问题详解
虚拟化和云计算文章大合集
LeetCode 6096. 咒语和药水的成功对数(二分查找)
攻防世界PWN play 条件竞争漏洞的利用
Remember! Don't be too confident in writing code! Be sure to write some key log info output, or the problem will not be located.
[51nod p3395] n-bit gray code [bit operation]
@Value does not take effect and extend/implement other classes cannot inject beans manually
Standard template library (STL)
(dfs+ pruning + checkerboard problem +dood) acwing 843 N-queen problem
Exercise 7-10 finding specified characters (15 points)
[51nod p2106] an odd number of times [bit operation]
(dfs) acwing 842. Arrange numbers
静态变量与一个类相关联,只要该类在内存中(只要您的应用程序终止,该变量就不存在)就可以使用。(堆本体,栈引用)
Opencv face recognition of ros2 foxy~galactic~humble
云计算企业崛起 甲骨文数据库市场主导地位动摇
Learning makefile with me
Summary of random number learning
turtle库的使用数字时钟模拟时钟动态显示
LeetCode 1143. Longest common subsequence
Trees and binary trees: the concept of binary trees