Skip to content
Advertisement

Set Xmx and Xms for java application running on k8s

I’ve an application running on k8s and would like to updated the java heapsize . I’ve updated the JAVA_OPTS environnement variable and set it in the deployment file as below

JavaScript

but when i run the below command it looks like my changes does not takes effect

JavaScript

I’m i wrong can someone help me and explain how to set hose values ?

Advertisement

Answer

I see that you used OpenJDK Alpine to deploy a JAVA application, so you need to use this environment “JAVA_TOOL_OPTIONS” instead of “JAVA_OPTS“, something like:

JavaScript

Once your application is running, you can check the application log and you will find the log below:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement