Jvm working memory and main memory

in working memory, there are method stack frames and registers. Pc, is understandable, but why should some referenced main memory variables be copied to working memory? I don"t think it"s necessary at all, which leads to cache consistency problems. Or is there a big price to pay for reading and writing main memory that I don"t know? (isn"t the working memory and the main village all in the physical memory? the access speed is not much different in theory, is it because of the price of lock? Or the competition for the bus? )

find all kinds of great solutions%

Mar.09,2021

there are two main types of variables that are copied from main memory to working memory. One explicitly defines local variables, such as XXX foo = this.bar; within the method, and the other is in multicore or multi-CPU systems where data in main memory is read into different caches.

the former actually only affects the reference type, while the latter affects the consistency of all read variables.

Menu