0

When using -Xmx flag, what happens if the argument given exceed physical memory?

Also is there any way to explicitly make JVM to use a specific amount of memory using paging?

2
  • For the first question: The JVM will execute just fine. It might crash when it tries to allocate more memory than what is available, but it'll start up fine. Not sure if/how virtual memory plays into this. No idea about the second question. Commented Jun 9, 2014 at 22:54
  • Are you talking about a specific brand of JVM at all? They do differ in their memory handling implementations. Commented Jun 9, 2014 at 23:08

1 Answer 1

1

See for yourself:

Trying for a heap too large

JVM fails in getting enough memory for the heap and exits.

I don't think there is a way to make JVM use a specific amount of memory for paging, but you can use:

-XX:+|-UseLargePages --for large page support

and -XXLargePageSizeInBytes=<n> --for specifying how large your large pages can be.

Look at http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/java.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.