Java Virtual machine Learning-Architecture memory model (reprint)

Source: Internet
Author: User
Tags xms

    • One: Java technology system module diagram
    • Two: JVM Memory area model

1. Method Area

Also known as "permanent generation", "non-heap", it is used to store virtual machine loaded class information, constants, static variables, is the memory area shared by each thread . The default minimum value is 16MB and the maximum value is 64MB, which limits the size of the method area through the-xx:permsize and-xx:maxpermsize parameters.

Run a constant pool: is a part of the method area, in addition to the class file has a version of the classes, fields, methods, interfaces, and other descriptive information, there is also a const pool, used to hold the compiler generated a variety of symbol references, which will be placed in the method area after the class loaded in the run constant pool.

2. Virtual Machine Stack

thread-Private .

  local variable table holds the various basic data types known to the compiler (Boolean, Byte, char, short, int, float, long, double), object reference (reference pointer, not the object itself), Where 64-bit long and double-type data takes up 2 local variables, the remaining data types are only 1. The memory space required for a local variable table is allocated during compilation, and when entering a method, this method requires that the local variable allocated in the stack frame is fully deterministic, and the stack frame does not change the size space of the local variable table during the run time.

3. Local method Stack

Similar to the virtual machine stack, the difference lies in the Java method service that the virtual machine stack executes for the virtual machine, while the local method stack serves the native method.

4. Heap

also called Java The heap, GC heap is the largest memory area managed by the Java Virtual machine, and is also the

Cenozoic:

The newly created object of the program is to allocate memory from the Cenozoic, and the Cenozoic is made up of Eden Space and two blocks of survivor space of the same size (usually called S0 and S1 or from and to), which can be specified by the-XMN parameter, or by-XX: Survivorration to adjust the size of Eden space and survivor space.

old age:

5. Program Counter

is the smallest piece of memory area, its role is the current thread executes the byte code of the line number indicator, in the virtual machine model, the bytecode interpreter works by changing the value of this counter to select the next need to execute the byte code instruction, branch, loop, exception handling, Basic functions such as thread recovery need to rely on counters to complete.

    • Three: Direct Memory

Direct memory is not part of the virtual machine memory, nor is it a memory area defined in the Java Virtual Machine specification. The newly added NiO in jdk1.4, which introduces the IO mode of channel and buffer, can call the native method to allocate out-of-heap memory directly, which is the native memory and does not affect the size of heap memory.

this text link: http://blog.csdn.net/java2000_wl/article/details/8009362 reprint please specify the source!

Source: >



From for notes (Wiz)



Java Virtual machine Learning-Architecture memory model (reprint)

Related Article

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.