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

auto-limit java heap size #40

Closed
jazzl0ver opened this issue Feb 21, 2018 · 2 comments
Closed

auto-limit java heap size #40

jazzl0ver opened this issue Feb 21, 2018 · 2 comments

Comments

@jazzl0ver
Copy link
Collaborator

Let's add these keys to JVM settings for all services:

-XX:+PrintCommandLineFlags -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

Thus we wouldn't need to limit the java heap size, it will be done automatically by reading container limits.

@JuniusLuo
Copy link
Contributor

Thanks for the suggestion!

It is probably not good to enable the experimental vm options. Not sure whether it will impact the service stability. Do not hear any service recommends to use the experimental vm options.

Inherit the container limits may have unexpected limits. Currently the container max memory is not a must-have parameter when creating the service. The default container max memory is -1, which allows the container to use as many memory as possible. Usually one node will only run one stateful service. So the stateful service could safely use all memory. JVM process may have the off-heap handling to reduce the java GC imapct. For example, Cassandra could have offheap memtable, see Cassandra JVM tuning. It would be better to separate the configs for JVM heap and container max memory.

@jazzl0ver
Copy link
Collaborator Author

Thank you for the explanation!

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

No branches or pull requests

2 participants