I didn’t find any discussion on this issue so I’ll bring it up, just in case.
You might be aware that the PermGen memory space was removed in Oracle Java 8. You might have seen such a notice if using Java 8:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
To summarize, class metadata has been moved to native memory and the option MaxPermSize has been replaced with MaxMetaspaceSize, which is analogous to the deprecated option. By default, MaxMetaspaceSize is unlimited but there are reasons for limiting it. For a long summary, see, for example: https://dzone.com/articles/java-8-permgen-metaspace
I see two issues here:
- During development/QA, some reasonable value for MaxMetaspaceSize should be used so as to ensure excessive amounts of memory is not used for class metadata.
- For production environments, some monitoring and tuning may be necessary so as to find a suitable value.
I’m not sure how this change should be handled but I guess documenting this change might be a good start. Also, there are some usages of MaxPermSize in the sources of opemrs-core.