Help Center> Cloud Container Engine> FAQs> Workload> Container Configuration> What Can I Do If an Error Is Reported When a Deployed Container Is Started After the JVM Startup Heap Memory Parameter Is Specified for ENTRYPOINT in Dockerfile?
Updated on 2022-08-15 GMT+08:00

What Can I Do If an Error Is Reported When a Deployed Container Is Started After the JVM Startup Heap Memory Parameter Is Specified for ENTRYPOINT in Dockerfile?

Problem Description

After the JVM startup heap memory parameter is specified for ENTRYPOINT in the Dockerfile, an error message "invalid initial heap size" is displayed during the deployed container's startup, as shown in the following figure:

Answer

Check the ENTRYPOINT settings. The following settings are incorrect:

ENTRYPOINT ["java","-Xms2g -Xmx2g","-jar","xxx.jar"]

You can use either of the following methods to solve the problem:

  • (Recommended) Write the container startup command in Workloads > Container Settings > Lifecycle > Startup Command, then the container can be started properly.
  • Change the format of the ENTRYPOINT startup command to the following:
    ENTRYPOINT exec java -Xmx2g -Xms2g -jar xxxx.jar

Container Configuration FAQs

more