JVM Memory Architecture vs Java memory model vs Java object model

Source: Internet
Author: User
Tags object model java se

In the previous articles, the system learned the next JVM memory structure, Java memory model, Java object model, but found themselves or the three concepts and differences are more vague, silly points unclear. So there is this article, this article is mainly on these three technical points to make a summary and distinguish, deepen the impression.

JVM Memory Structure

The JVM runtime memory area structure is described in the Java Virtual Machine specification (Java SE 8) as follows:

In other words, the JVM memory structure is defined by the Java Virtual Machine specification, which describes the different data regions managed by the JVM during the execution of the Java program.

Java memory model

First, we know that Java multithreading is through shared memory communication, and because of the use of shared memory for communication, in the communication process there will be a series of issues such as visibility, atomicity, sequencing, and JMM (Java Memory Model) is a model built around multi-threaded communication and a series of features associated with it. It's just an abstract concept. JMM defines some syntax sets that map to the Java language, which are keywords such as volatile, synchronized, and so on.

Java Object Model

Java is an object-oriented language, and Java objects are stored in the JVM with a certain structure. The storage model for the Java object itself is called the Java object model.

In the hotspot virtual machine, a Oop-klass Model is designed. OOP (Ordinary object Pointer) refers to a normal object pointer, and Klass is used to describe the specific type of an object instance.

As shown, the Oop-klass model of a simple Java object, the Java object model.


Finally, let's make a simple distinction between the three concepts. The JVM memory structure is related to the runtime region of the Java Virtual machine. Java memory model, related to concurrency programming in Java. The Java object model is related to the representation of Java objects in virtual machines.


JVM Memory Architecture vs Java memory model vs Java object model

JVM Memory Architecture vs Java memory model vs Java object model

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.