The startup command is as follows:
java -server -Xms128m -Xmx128m -jar xxxx.jar
The top command displays the following:
Pidouerprini virtres s% Central Processor% MEM TIME+COMMAND 15332 root 17 0 555m 242m 11m S 0.0 12.1 1:46.95 java
Why are VIRT and RES larger than 128m? Did -Xms -Xmx not work?
These two parameters are only limit values
Heap of Java programSize, if you understand
StackThen it should be known that generally only
Objects dynamically created at runtimeOnly exists in
$ java -X ... -Xms<size> set initial Java `heap size` -Xmx<size> set maximum Java `heap size` ...
In addition, through
TopThe resources viewed by the command are for the entire Java process, and the JVM needs to load the entire Java code when executing it.
Java Runtime, have their own expenses, these are not included in
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.