Java 8 memory options

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:

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.

1 Like

Hi Mikko,

Thanks for the posting, we realized this when we were upgrading core to build against java 8 and documented this in our java 8 upgrade notes for developers and implementations, i have updated the pages to mention the new VM option to limit available memory.

1 Like