rmaruszewski
rmaruszewski

Reputation: 2417

How to limit total memory consumed by Java 8 application?

In order to limit total memory consumed by Java 7 application I could use the following formula (taken from this article):

Max memory = [-Xmx] + [-XX:MaxPermSize] + number_of_threads * [-Xss]

How this formula changes for Java 8 application, after PermGen has been removed?

Should I use option "-XX:MaxMetaspaceSize" to limit the maximum memory consumed by metaspace instead?

Upvotes: 13

Views: 4488

Answers (1)

apangin
apangin

Reputation: 98620

Yes, there is -XX:MaxMetaspaceSize instead of -XX:MaxPermSize.

Consider also -XX:MaxDirectMemorySize to limit memory for direct ByteBuffers.

Upvotes: 8

Related Questions