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:MaxP
Yes, there is -XX:MaxMetaspaceSize instead of -XX:MaxPermSize.
-XX:MaxMetaspaceSize
-XX:MaxPermSize
Consider also -XX:MaxDirectMemorySize to limit memory for direct ByteBuffers.
-XX:MaxDirectMemorySize