Introduction to the location and function of each memory area of the Java Virtual machine

Source: Internet
Author: User

Java Virtual Runtime data area:

Relevant area Description:

Program Counter:

Function: The line number indicator of the byte code executed by the current thread. If the Java method records the instruction address, if the native method is not logged

Isolation: Thread Isolation

Error: None

Java Virtual machine stack :

Features: Describes the memory model that Java methods perform: Each method executes a stack frame that stores information such as local variable tables, operand stacks, dynamic links, method exits, and so on.

Isolation: Thread Isolation

Error: Stackoverflowerror exception is thrown when the stack depth of a thread request is greater than the depth allowed by the virtual machine;

The dynamic extension fails to request enough memory to throw a OutOfMemoryError exception.

Local Variables table: The memory space required for a local variable table is allocated during compilation, containing various basic data types, and object references.

Local method Stack:

  Function: The native method service that is used by the virtual machine. (Virtual machine stack is a Java method (i.e. bytecode) service)

Isolation: Thread Isolation

Error:stackoverflowerror and OutOfMemoryError

Java heap:

  Functions: Storing object instances

Isolation: Thread sharing

Error:outofmemoryerror

Subdivision: The angle of memory recycling: New generation, Laosheng generation

Memory allocation angle: The Java heap may divide multiple thread-private allocation buffers.

Virtual machine limit: No contiguous memory space required, can be fixed size or extensible

Method Area:

Features: Store class information, constants, static variables, even compiler-compiled code, that have been loaded by the virtual machine.

Isolation: Thread sharing

Error:outofmemoryerror

Virtual Machine Limitations: No contiguous memory space is required, can be fixed size or extensible, and this area of memory recycling is primarily for the collection of constant pools and unloading of types.

  Run a constant pool: part of a method area

    Functions: Used to store various literal and symbolic references generated during the compilation period, and direct references translated

Features: Dynamic, you can also put new constants into the pool during run time.

Error:outofmemoryerror

Introduction to the location and function of each memory area of the Java Virtual machine

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.