Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (3.9k points)

If I omit the -Xmxn option from the Java command line then a default value will be used. According to Java documentation

"the default value is chosen at runtime based on system configuration"

What system configuration settings influence the default value?

1 Answer

0 votes
by (46k points)

On Windows, you can apply the subsequent command to find out the defaults on the system wherever your applications run.

java -XX:+PrintFlagsFinal -version | findstr HeapSize

Watch for the opportunities MaxHeapSize (for -Xmx) and InitialHeapSize for -Xms.

On a Unix/Linux system, you can make

java -XX:+PrintFlagsFinal -version | grep HeapSize

I think the resulting product is in bytes.

Related questions

0 votes
1 answer
asked Aug 29, 2019 in Java by Nigam (4k points)
0 votes
1 answer
0 votes
1 answer
asked Sep 11, 2019 in Java by Krishna (2.6k points)
0 votes
1 answer

Browse Categories

...