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

Memory Calculator doesn't recognize max memory value under cgroupsv2 #176

Closed
dmikusa opened this issue May 25, 2022 · 0 comments
Closed
Labels
type:bug A general bug

Comments

@dmikusa
Copy link
Contributor

dmikusa commented May 25, 2022

What happened?

When running a container built with paketo-buildpacks/java on a system that uses cgroupsv2 and no memory limit is set, then you will see the following message:

WARNING: Unable to convert memory limit "max" from path "/sys/fs/cgroup/memory.max" as int: memory size "max" does not match pattern "^([\\d]+)([kmgtKMGT]?)$"

Followed by...

Calculating JVM memory based on 20801716K available memory

What's happening is that when there is no memory limit set, the literal value in /sys/fs/cgroup/memory.max is max. The buildpack doesn't presently understand this so it tries to parse it as value and fails. That generates the first error.

The buildpack then goes and reads /proc/meminfo, which it does successfully, and picks out the value listed in the message Calculating JVM memory based on....

This generally works out OK because there is no container memory limit set and the memory calculator will essentially use all of the memory on the system. At the same time, the error message is confusing and we can improve the situation.

This PR is for the memory calculator to recognize the option max and use all available memory when that is the case.

@dmikusa dmikusa added the type:bug A general bug label May 25, 2022
@dmikusa dmikusa closed this as completed Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant