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?
Yes, there is -XX:MaxMetaspaceSize
instead of -XX:MaxPermSize
.
Consider also -XX:MaxDirectMemorySize
to limit memory for direct ByteBuffers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With