Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the java8 template to honor cgroups memory limits #130

Merged
merged 1 commit into from
Feb 21, 2019
Merged

Update the java8 template to honor cgroups memory limits #130

merged 1 commit into from
Feb 21, 2019

Conversation

tessellator
Copy link
Contributor

This commit upgrades the openjdk version to the earliest that supports
cgroup memory limits. It also applies the JVM arguments required to
enable the support.

This change is needed for the JVM to recognize the actual memory
made available to it via the container instead of believing it has
access to the amount of memory possessed by the node running the
container.

Signed-off-by: Chad Taylor [email protected]

Description

This PR updates the java8 template to use a newer version of the OpenJDK that supports cgroup memory limits. It also updates the JVM to use the flags necessary to enable the cgroup memory limits support in production.

Motivation and Context

  • I have raised an issue to propose this change (required)

Which issue(s) this PR fixes

Fixes #129

How Has This Been Tested?

Using this template and the function defined in #129, I was able to successfully invoke the function without crashing the container and receiving a 200 OK response with Allocated more than 80% (75.5 MiB) of the max allowed JVM memory size (89.0 MiB)% in the body.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This commit upgrades the openjdk version to the earliest that supports
cgroup memory limits. It also applies the JVM arguments required to
enable the support.

This change is needed for the JVM to recognize the actual memory
made available to it via the container instead of believing it has
access to the amount of memory possessed by the node running the
container.

Signed-off-by: Chad Taylor <[email protected]>
@alexellis
Copy link
Member

SGTM

@alexellis alexellis merged commit a25d409 into openfaas:master Feb 21, 2019
@alexellis
Copy link
Member

Is there anything else we need to do around Java? I'd like your help to review #86

@tessellator
Copy link
Contributor Author

I'll take a look this morning.

@alexellis
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java8 template does not honor container memory limits
2 participants