前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >JVM 架构 : 运行时数据区 & 内存结构

JVM 架构 : 运行时数据区 & 内存结构

作者头像
一个会写诗的程序员
发布2021-12-16 11:26:16
3280
发布2021-12-16 11:26:16
举报

JVM : Java Virtual Machine 架构

JVM Architecture Runtime Data Area/Memory Structure

Classloader

Class loader is a subsystem in JVM, which is primarily responasible for loading the java classes, there are 3 different class loaders :

  • Bootstrap Classloader is the super class loader, which primharily loads the rt.jar, which contains the java.lang, java.net, java.io, java.sql package classes
  • Extension Classloader is the sub of Bootstrap Classloader, it loads the library under JRE_HOME/lib/ext directory
  • System/Application Classloader is the sub of ExtenstionClassloader, it loads the classes from the classpath, specified using the java -cp comrmand.

We can also create our own classloader by extending the Classsloader class Classloader is primarily performs three basic activities, in this order Loading → Linking - Initialization

JVM 内存区域

Runtime Data Areas(Heap | Method Area | JVM Stacks | PC Register | Native Stacks)

JVM 堆内存区域 Heap

Heap 数据结构

METHOD AREA / PERMANENT

Created at JVM startup and shared among all threads like Heap.

Per Thread Runtime Data Areas : PC Register & Stack Frame

  • Local Variable Array
  • Operand Stack
  • Reference to Constant Pool

JVM Execute Engine

Interpreter

Interpreter is the one that reads the class files or bytecode and exectutes it one by one. The problem with the interpreter is that, when a method is called multiple times, it interprets those lines of bytecode again and again.

JIT compiler

JIT compiler helps in overcoming the problem of the interpreter. When repeated method calls occur, JIT compiler compiles the bytecode to native code. This native code will be used directly for repeated method calls . JIT compiler contains few components to achieve this feature.

Java native method interface

It is responsible for interacting with native libraries and makes it avvailable for the JVM execution engine.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2021/8/19 上,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • JVM : Java Virtual Machine 架构
    • Classloader
    • JVM 内存区域
    • JVM 堆内存区域 Heap
    • Heap 数据结构
    • METHOD AREA / PERMANENT
    • Per Thread Runtime Data Areas : PC Register & Stack Frame
    • JVM Execute Engine
      • Interpreter
        • JIT compiler
          • Java native method interface
          领券
          问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档