0

How do I specify -Xms1g, -Xmx1k, and -XX:HeapDumpOnOutOfMemoryError to the Java VM when I run my application.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
  • 3
    How do you run your application? And those arguments make no sense. A minimum of 1 gig, and a maximum of 1 kb? One sixty fourth the ram in a commodore 64? – Elliott Frisch Apr 22 '20 at 00:48
  • 2
    Does this answer your question? [Specifying JVM arguments when calling a jar file?](https://stackoverflow.com/questions/5891123/specifying-jvm-arguments-when-calling-a-jar-file) – Martheen Apr 22 '20 at 00:56

1 Answers1

1

How are you executing your application?

  1. Are you trying to get the heap dump if the application runs into Out Of Memory error, if yes, you can use jconsole and the right command is -XX:+HeapDumpOnOutOfMemoryError

  2. The flag -Xmx specifies the maximum memory allocation pool for a Java virtual machine (JVM), while -Xms specifies the initial memory allocation pool and hence the value for Xmx should be greater than Xms,

    you would need to correct your argument values.

Community
  • 1
  • 1
MirzaGaush
  • 11
  • 3