Search code examples
jvmibm-cloudcloud-foundry

How to configure JVM memory settings in Bluemix?


I am using Cloud Foundry on Bluemix, and my app is constantly running out of metaspace. I am using OpenJDK 1.8 buildpack (https://github.com/cloudfoundry/java-buildpack.git), which has a default metaspace setting of 64M.

How do I configure and tune the JVM's memory settings to give it more metaspace?

Thanks Patrick


Solution

  • I was digging into the java buildpack and ran into an issue on github that described the fix. You need to set it with the following for 128m.

    cf set-env appname JBP_CONFIG_OPEN_JDK_JRE '[memory_calculator: {memory_heuristics: {heap: 70, metaspace: 15, native: 10, permgen: 15, stack: 5}, memory_sizes: {metaspace: 128m}}]'