JVM summary

JVM memory model diagram

The method area stores the loaded class information (name, modifier, etc.), static variables in the class, constants defined as final types in the class, Field information in the class, and method information in the class. When obtaining information through the methods such as getName and isInterface in the Class object, these data all come from the method area, and the method area is also shared globally. Under certain conditions, it will also be GCed. When the method area needs to use the memory When it exceeds its allowable size, an OutOfMemory error message will be thrown

Summary:
Java runtime data area can be divided into method area, heap, stack, program counter, local method stack

Heap: Java objects, shared between threads

Stack: Method operation, each method corresponds to a stack frame, each thread corresponds to a stack,

Each stack frame includes operands, local variable tables, references to runtime constant pools, method return addresses, and additional bit areas, so threads are not shared

Method area (static area): class information loaded by the virtual machine, static variables, constants (final), code compiled by the real-time compiler and other data. The running constant pool is part of the method area. In addition to the description information of the class version, field, interface, method, etc., the class file also has an information constant pool to store the literals and symbolic references generated at compile time. shared between threads.

Program counter: Point out the location to return to after executing a certain instruction at a certain time, when executing a Java method, save the current execution address here, if executing a local method, then the program counter is empty . Threads are not shared.

引用出处:
http://www.cnblogs.com/sunada2005/p/3577799.html
http://blog.csdn.net/ns_code/article/details/17565503

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326091389&siteId=291194637