When Tomcat is started, the following message is displayed: Error occurred during initialization of VM Cocould not reserve enough space for object heap In the bin directory of Tomcat, Catalina. the Tomcat memory parameter configuration in the sh file is too large and exceeds the total available memory of the machine. modify it to the appropriate value. The modified parameter is java_opts = "-xms50m-xmx60m"
To obtain the maximum memory parameter value:
Run the Java-xmxxxxxm-version command on the command line to test the function. Then, the XXXX value is gradually increased. If the execution is normal, the specified memory size is available. Otherwise, the error message is printed. "Error occurred during initialization of vmcocould not reserve enough space for object Heap"
I ran Tomcat all the time yesterday. This morning, I found that all the web pages that passed the test yesterday had problems. The instinct was that Tomcat had problems and simply restarted tomcat.
Then the problem occurs. When Tomcat is closed, "error occured during initialization of VM. cocould not reserve enough space for object heap." appears. At the same time, Tomcat cannot be closed normally.
After searching, modify the bin/Catalina. Sh script and add the followingCode:
Java_opts = "-server-xms256m-xmx1024m-XX: permsize = 600 m-XX: maxpermsize = 600 m-DCOM. Sun. Management. jmxremote"
Run bin/shutdown. Sh to close Tomcat normally.