Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How JVM Runtime data area

Shulou Source: shulou.com Published: 2022-06-02 01:30:32 09月25日 Update

How to run the JVM data area, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

1. Runtime data area

1) Heap: thread sharing, storing newly created objects.

2) method area: thread sharing, storing class information, constants, static variables, etc.

3) Virtual machine stack: thread independent, also known as thread stack. Used to store local variables within the thread, first in and then out of the FILO. The stack consists of stack frames, which are divided into local variables, Operand stacks, dynamic links and method exits. Smaller local objects generated in threaded methods may also be stored in the virtual machine stack. Local variable scale: store local variables.

Stack frame: java allocates a stack frame in stack memory for each method to isolate local variables in each method.

Operand stack: temporary memory space used to process data when a thread is running.

Dynamic links:

Method exit: returns the execution position of the parent method when the method execution is completed.

4) Local method stack: the memory space allocated when java calls local methods (native-decorated methods).

5) Program counter: the bytecode line number indicator executed by the current thread, recording the line to which the code is executed

two。 Parameter setting

Heap:

-minimum Xms.

-maximum Xmx.

Method area:

-XX:MetaSpaceSize defaults to 21 MB. Gc will be performed when the memory is almost full, and the capacity expansion is determined according to the amount of space left after the gc. It is generally set to 256m in production.

-XX:MaxMetaSpaceSize defaults to-1 and does not limit the maximum value.

Stack:

-Xss defaults to 1m

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Methods threads variables local memory data run space maximum dynamic object Operand maximum link exit allocation help minimum clear one line Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Redmi Linux macOS MySQL