java-buildpack: java-buildpack incompatible with the use of cf scale -MEMORY cmd

The java-buildpack statically applies memory heuristics at staging time, i.e. includes the -Xmx option in the start cmd. As a result, if a user is using the cf scale -memory command to decrease the memory, the JVM will still try to allocate up to the initial memory account. The jvm will then exceed the memory limit and be killed by the warden container.

Possible workaround: apply the memory heuristics within the droplet using the http://docs.cloudfoundry.com/docs/using/deploying-apps/environment-variable.html#VCAP_APPLICATION limits entry.

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 21 (15 by maintainers)

Commits related to this issue

Most upvoted comments

@nebhale We’re implementing some auto-scale behaviour and ran into this restage issue again. It is one thing to know you must restage when scaling a java app via the CLI. But when a user is setting up auto scale rules, asking them to restage or restart depending on the buildpack used is yet another annoying side effect of staging time memory heuristics.

I’ve never been a fan of this behaviour and the complexities it propagates to the user. Auto scale rules is yet another example of this complexity pushed to the user. I hope that you guys haven’t given up completely on a startup time memory heuristics solution sometime in the future.