What exactly is the working memory and main memory of the jvm memory model? On what level is the division made?

This question arises naturally after reading 12 chapters of teacher Zhou Zhiming"s "in-depth understanding of the JVM Virtual Machine". In the book, teacher Zhou does not specify which logical level the two concepts are divided on, but only says that "memory partitioning is not the same level as Java heap, stack, method area, etc.". Here, I would like to ask you which level of memory partition these two concepts are? Is it true that on the real physical memory, the physical memory allocated to each thread really delimits an area as the "working memory", and then there is a separate piece of physical memory as the "main memory"?

Mar.08,2022

first of all, storage management can be divided into three levels, hardware level, operating system level, and application level.

from the hardware level, the storage system can be divided into external memory, main memory, cache and register, the latter three are also called memory. For CPU, register is the working memory of CPU, and main memory and cache are used as buffers of out-of-memory data.

In order to facilitate the storage management, the

operating system abstracts the concept of address space and divides the address space into code segments, data segments, shared segments, data segments into heaps and stacks, and so on.

JMM is a memory model abstracted by the application layer to manage memory conveniently. The implementation of this abstract memory model depends on the abstraction of the address space of the operating system, and finally falls to the hardware level.

JMM abstract memory model can be described by the following figure:

JMM.png

JMM

JMM

JMM.png


is very natural, which means that what you have seen is not enough, or that your knowledge network has not been covered to this level, because this association is very normal. The book first clearly states the gap between cpu and io processing, but registers cannot directly bridge this gap. So cache is introduced, but the relationship between cache and main memory and between multiple CPU who writes to main memory first. Each core has its own cache , analogically to JMM every thread has its working memory and main memory

.
Menu