Our installer updates our application from using java7 to java8. In doing so, we'd like to update their Tomcat7 configuration to limit the Metaspace at the same level as their PermGen space (which they might have customized). So if they had...
-XX:MaxPermSize=256m
we'd like to set...
-XX:MaxMetaspaceSize=256m
The trick is, the installer must do this via a batch file. (Perhaps querying Tomcat with some command that would spit out the present value to a file, and then read that value in, and then fire off another command to set the value.)
If I can get the present MaxPermSize
, I know that last piece of the puzzle:
"%TOMCAT7_EXE%" %SERVICE_NAME% --JvmOptions "-XX:MaxMetaspaceSize=%MAX_SIZE%"
(It might also be nice to remove the no longer applicable MaxPermSize
, but that would be just for extra-credit.)