0

I'm automating a mule stack. The client wants his java binary to run with

-DXX:MaxPermSize=4096M -XX:MaxPermSize=4096m

Can someone explain the difference between DXX and XX memory allocation?

Balázs Édes
  • 13,452
  • 6
  • 54
  • 89
Jepper
  • 1,092
  • 3
  • 11
  • 24
  • Possible Duplicate [Link] (http://stackoverflow.com/questions/16587727/to-increase-maxpermsize-memory-in-java-by-command-line) – Mandar Pandit Jun 11 '14 at 12:15

2 Answers2

3

-D[...] is just a flag to set a "system property". Unless anything looks at that system property, it will have no effect at all.

For example:

System.out.println(System.getProperty("XX:MaxPermSize"));

... will print out "4096M" in your example, but would normally print out null as the property wouldn't be defined.

The second flag is a flag the JVM itself can use to affect memory allocation - although any -X flag is non-standard and subject to change without notice.

Basically, it sounds like your client may be a bit confused, and you should ask them if they have any good, solid reason for specifying a system property as well as a JVM flag.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
1

-D is to add system property.

like

-Denv=test/live

so env will be test or live.

Vinit Prajapati
  • 1,593
  • 1
  • 17
  • 29