I'm getting this when I try to push my Tomcat project to IBM Cloud:
Cannot calculate JVM memory configuration: There is insufficient memory remaining for heap. Memory available for allocation 256M is less than allocated memory 578931K(-XX:ReservedCodeCacheSize=240M,-XX:MaxDirectMemorySize=10M, XX:MaxMetaspaceSize=66931K, Xss1M * 250 threads)
I cannot increase the memory limit. I tried using JVM flags to reduce the JVM’s memory usage in manifest.yml file:
env:
JAVA_OPTS: '-XX:MaxMetaspaceSize=80780K -Xss160k -Xmx200M -XX:ReservedCodeCacheSize=16M -XX:MaxDirectMemorySize=16M'
and tried to use an older version of java buildpack, also in manifest.yml file:
buildpack: https://github.com/cloudfoundry/java-buildpack#v3.19.2
but I got errors doing both things. What can I do to solve this?
JAVA_OPTS
since you set-XX:ReservedCodeCacheSize=16M
and the error still reports-XX:ReservedCodeCacheSize=240M
. Find a way to reliably setJAVA_OPTS
– cmoetzingenv
block. Try throwing your manifest.yml into a YAML validator to make sure it's formatted properly.@cmoetzing it's not picking up your changes. Also, don't switch back to using JBP v3. You should absolutely be using the latest v4.x. – Daniel Mikusa