These two parameters are just the limit value Java程序的heap size. If you understand heap and stack then you should know that generally only 运行时动态创建的对象 exists in heap
$ java -X
...
-Xms<size> set initial Java `heap size`
-Xmx<size> set maximum Java `heap size`
...
In addition, the resource status viewed through the top command is for the entire Java process. When the JVM executes your Java code, it also needs to load the entire Java Runtime, which has its own overhead. These are not included in -Xms/-Xmx中
From Oracle's Documentation:
Note that the JVM uses more memory than just the heap. For example
Java methods, thread stacks and native handles are allocated in memory
separate from the heap, as well as JVM internal data structures.
Because you just set the maximum value of java heap memory. In addition to the heap, the jvm also has a stack, method area, and constant pool.
In fact, even if the maximum value of each memory area is set, the final memory usage may still be exceeded. Because memory management also requires memory
These two parameters are just the limit value
Java程序的heap
size. If you understandheap
andstack
then you should know that generally only运行时动态创建的对象
exists inheap
In addition, the resource status viewed through the
top
command is for the entire Java process. When the JVM executes your Java code, it also needs to load the entireJava Runtime
, which has its own overhead. These are not included in-Xms/-Xmx
中From Oracle's Documentation:
The memory occupied by top also includes PermSize, etc., which is the total of the entire process. Okay, let me ask a novice question
Because you just set the maximum value of java heap memory. In addition to the heap, the jvm also has a stack, method area, and constant pool.
In fact, even if the maximum value of each memory area is set, the final memory usage may still be exceeded. Because memory management also requires memory