4

There is a maximum memory java heap can use (as configured by -Xmx) and initial java heap size (-Xms).

How does -XX:+AlwaysPretouch play with them. Does it pretouch memory upto -Xms or -Xmx. e.g. when java is started with -Xmx=8G -Xms=4G -XX:+AlwaysPretouch, will its resident set be roughly 4G or 8G?

If this matters, i am interested in what happens on Linux and on java 7 and 9.

1 Answer 1

5

Xms (4G).

AlwaysPreTouch affects committed memory only. When the heap increases, JVM pretouches only new committed pages.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.