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

startupsh does not support environment variables specifying heap memory size settings #12013

Closed
caoyanan666 opened this issue Apr 24, 2024 · 2 comments
Labels
kind/discussion Category issues related to discussion

Comments

@caoyanan666
Copy link
Contributor

caoyanan666 commented Apr 24, 2024

For Example,I create Environment JAVA_OPT=-XX:+UseG1GC -Xms500m -Xmx500m, nacos startup.sh will ignore my setting and force use "-Xms512m -Xmx512m -Xmn256m" or "-Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m",
I want to use a size setting that is consistent with the actual business. For example, in an environment where costs are reduced and efficiency is increased, the boss only gives 1g of memory, and high availability must be required. In this case, I need to lower the heap memory size setting.

@KomachiSion
Copy link
Collaborator

Nacos docker images support this feature that set memory from ENV.

If you want release package also support it, I recommend to use a ENV to save it, such as CUSTOM_NACOS_MEMORY, If this ENV is not exist, use current default value, otherwise use CUSTOM_NACOS_MEMORY.

@KomachiSion KomachiSion added the kind/discussion Category issues related to discussion label Apr 25, 2024
@caoyanan666
Copy link
Contributor Author

OK, I'll adjust it.

KomachiSion pushed a commit that referenced this issue May 6, 2024
…NACOS_MEMORY (#12014)

* use DISABLE_NACOS_DEFAULT_MEMORY_SETTING

* use CUSTOM_NACOS_MEMORY

* Code optimization

* remove unuse

* startup.cmd support CUSTOM_NACOS_MEMORY environment variable

---------

Co-authored-by: caoyanan <caoyanan@growingio.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/discussion Category issues related to discussion
Projects
None yet
Development

No branches or pull requests

2 participants