Java Memory Area

Source: Internet
Author: User

Run-time data region

  • Program counter
    • Thread Private
    • Program Counter REGITER,PC is a small memory space that can be seen as the line number indicator of the bytecode that is being executed by the current thread.
    • Java virtual multithreading is achieved by rotating and assigning processor execution time, at any time a processor can only execute instructions in one thread. Therefore, in order for the thread to switch back to the correct execution location, each thread needs a separate program counter.
  • Java VM Stack (Java Virtual machine stack)
    • Thread Private
    • Life cycle: Same as Thread
    • Describes the memory model that Java methods perform: Each method creates a stack frame to hold local variables, operand stacks, and so on at execution time. Looks like the C language stack frame has the same place, just changed the name.
    • The Java memory area can be simply divided into stacks (stack) and heaps (heap) two blocks, and of course simply the simple allocation, which is actually more complex than this. Where the stack refers to (the virtual machine stack)
  • Local method Stack
    • Similar to the Java Virtual machine stack: The difference is that the Java Virtual machine stack Executes the Java method, and the local method stack executes the native method
  • Java heap
    • Thread sharing
    • Created when the virtual machine is started.
    • Purpose: To store object instances
    • Java heap is also the main administrative area of Brainiac (garbage COLLECTOR,GC) in Java
    • Allow physical discontinuity, only logically contiguous (at this point I think of the list in C)
  • Method area
    • Thread Sharing Zone
    • Store data such as class information, constants, static variables, and code compiled by the immediate compiler of the virtual machine.
  • Run a constant-rate pool
    • Part of the method area
    • Storing various literal variables and symbolic references generated during the compilation period
  • Direct Memory

Java Memory Area

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.