Got it

What does -xmx stand for in the java?

Created: May 11, 2022 08:53:20Latest reply: May 15, 2022 05:51:44 219 5 0 0 0
  HiCoins as reward: 0 (problem unresolved)

Hello, everyone!

What does -Xmx stand for in the java command?

Like 

java -Xmx512m

This is my question, please help me!

  • x
  • convention:

Featured Answers
olive.zhao
Admin Created May 11, 2022 09:00:22

Hello, friend!

-Xmx indicates the maximum memory allocated during JVM running. For example, -Xms512m indicates that the JVM process can occupy a maximum of 512 MB memory. 

java -X
  -Xmixed     mixed mode execution (default)
  -Xint      interpreted mode execution only
  -Xbootclasspath:<directories and zip/jar files separated by ;>
          set search path for bootstrap classes and resources
  -Xbootclasspath/a:<directories and zip/jar files separated by ;>
          append to end of bootstrap class path
  -Xbootclasspath/p:<directories and zip/jar files separated by ;>
          prepend in front of bootstrap class path
  -Xnoclassgc  disable class garbage collection
  -Xincgc    enable incremental garbage collection
  -Xloggc:<file>    log GC status to a file with time stamps
  -Xbatch        disable background compilation
  -Xms<size>      set initial Java heap size
  -Xmx<size>      set maximum Java heap size
  -Xss<size>      set java thread stack size
  -Xprof        output cpu profiling data
  -Xfuture       enable strictest checks, anticipating future default
  -Xrs         reduce use of OS signals by Java/VM (see documentation)
  -Xcheck:jni      perform additional checks for JNI functions
  -Xshare:off      do not attempt to use shared class data
  -Xshare:auto     use shared class data if possible (default)
  -Xshare:on      require using shared class data, otherwise fail.

Hope this helps!

View more
  • x
  • convention:

Saqibaz
Saqibaz Created May 15, 2022 05:51:36 (0) (0)
 
All Answers
olive.zhao
olive.zhao Admin Created May 11, 2022 09:00:22

Hello, friend!

-Xmx indicates the maximum memory allocated during JVM running. For example, -Xms512m indicates that the JVM process can occupy a maximum of 512 MB memory. 

java -X
  -Xmixed     mixed mode execution (default)
  -Xint      interpreted mode execution only
  -Xbootclasspath:<directories and zip/jar files separated by ;>
          set search path for bootstrap classes and resources
  -Xbootclasspath/a:<directories and zip/jar files separated by ;>
          append to end of bootstrap class path
  -Xbootclasspath/p:<directories and zip/jar files separated by ;>
          prepend in front of bootstrap class path
  -Xnoclassgc  disable class garbage collection
  -Xincgc    enable incremental garbage collection
  -Xloggc:<file>    log GC status to a file with time stamps
  -Xbatch        disable background compilation
  -Xms<size>      set initial Java heap size
  -Xmx<size>      set maximum Java heap size
  -Xss<size>      set java thread stack size
  -Xprof        output cpu profiling data
  -Xfuture       enable strictest checks, anticipating future default
  -Xrs         reduce use of OS signals by Java/VM (see documentation)
  -Xcheck:jni      perform additional checks for JNI functions
  -Xshare:off      do not attempt to use shared class data
  -Xshare:auto     use shared class data if possible (default)
  -Xshare:on      require using shared class data, otherwise fail.

Hope this helps!

View more
  • x
  • convention:

Saqibaz
Saqibaz Created May 15, 2022 05:51:36 (0) (0)
 
olive.zhao
olive.zhao Admin Created May 11, 2022 09:08:02

If you want to know more information about -Xmx, See What's the difference between XMX, XMS and XSS in JVM?


View more
  • x
  • convention:

user_4147187
user_4147187 MVE Created May 13, 2022 08:42:20

Hello,

In Java, -Xms sets the initial Java heap size, while-Xmx sets the maximum Java heap size.


e.g,
# Start with 128MB of memory, and allow the Java process to use up to 1024MB of memory.
java -Xms128m -Xmx1024m
# Start with 256MB of memory, and allow the Java process to use up to 4G (4096MB) of memory.
java -Xms256m -Xmx4g

View more
  • x
  • convention:

Saqibaz
Saqibaz Created May 15, 2022 05:51:44

Good answer
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.