Jvm runtime memory parsing and jvm runtime memory Parsing

Source: Internet
Author: User

Jvm runtime memory parsing and jvm runtime memory Parsing

I. jvm Concept

  Before learning about the concept of jvm, let's first understand the logic structure of the java platform. The picture is from deep java virtual machine.

  

 

We can see that jdk contains jre, java language and java development tools and APIs. jre contains the basic class library and java virtual machine running java, and the java Virtual Machine supports the running of java programs.

Jvm (java virtual machine) is translated into a java virtual machine. Literally, jvm is a virtual machine. In fact, similar to an operating system, a virtual machine is virtualized through software, it helps us manage computer memory and call computer hardware. Jvm is the virtual machine used to run java programs. When java programs are running, jvm converts the java bytecode file to the machine language recognized by the current physical machine and manages the memory when the program is running, run the code of the current program and call related hardware to obtain the program running result.

Ii. Working Principles of java programs.

Java program source file (. java) compiled by the java compilation tool. class file, which is read by the class loader in jvm. class, and execute the bytecode command. During this period, jvm also manages the running memory of java programs and calls related hardware through the operating system.

  

Iii. jvm runtime Memory Distribution

  During jvm running, data during java program running is divided into the following parts:

  

(1) program counter: Address for storing the execution of the Virtual Machine bytecode
(2) java Virtual Machine Stack: local variable table, operand stack, and method exit during java method running
(3) Local method Stack: similar to the Java Virtual Machine stack, local variable tables, operand stacks, and method egress are stored when Native local methods are run.
(4) Method Area: stores program constants, static variables, loaded class information, and the Code Compiled by the compiler in real time.
(5) java heap: it is the largest memory in a virtual machine and is used to store object instances.
(6) Run-Time pool: A Part Of The method area that stores constants and symbol references during running.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.