Java Virtual Machine--->> program counters

Source: Internet
Author: User

The program counter is a small memory space that can be seen as the line number indicator that is executed by the current thread. In the concept model of virtual machines (only the conceptual model, a variety of virtual machines may be implemented in some more efficient way), the bytecode interpreter studio is to select the next byte code instruction to execute, branch, loop, jump, exception handling by changing the value of this counter, Basic functions such as thread recovery need to rely on this counter to complete.

Because the multithreading of a Java Virtual machine is implemented in a way that threads take turns switching and allocating processor execution time, at any given moment, a processor (a kernel for a multicore processor) simply executes the 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, the counters between the threads do not affect each other, isolated storage, we call this kind of memory area "thread-private memory."

If the thread is executing a Java method, this counter records the address of the executing virtual machine bytecode instruction, and if the native method is being executed, the counter value is empty. The secondary memory area is the only area in the Java Virtual Machine specification that does not stipulate outofmemoryerror conditions!

Java Virtual Machine--->> program counters

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.