Java VM options for use in production

From software engineering blogger Anatoliy Sokolenko, this post is a cheatsheet with enumeration of options, which should be always used to configure Java Virtual Machine for Web-oriented server applications in production or production-like environments.

Do you agree? Have you found options that work well (or not well) for OpenMRS in production? Reply and share them with others here in the community!


This is very interesting and useful summary. Some of those are not very useful and will affect performance

  1. Like someone’s already mentioned in the comments section that the DNS caching is not required from Java 7+… it will most likely decrease performance and should be left to the underlying OS or DNS cache ton handle and not JVM
  2. Similarly logging GC is an overhead that should be avoided, unless you suspect that the application is performing poorly during GC, such as cyclical lags or paging spikes at regular intervals.
  3. Similarly dumping out of memory exceptions isnt useful since OpenMRS will already log the point at which the system used for PermGen space that was allocated. If you needed more details then one might do it in the debugging process, but no use of adding that overhead in production
1 Like