Add #!/bin/sh under the first line of tomcat/bin/catalina.sh
java_opts="-server-xms512m-xmx1024m -xx:maxnewsize=512m-xx:permsize=128m-xx:maxpermsize=256m- Djava.awt.headless=true"
-xms256m JVM Initial allocation of heap memory, production environment is recommended to xmx the same, set to more than 1024m
-XMX512M JVM Maximum allowable allocated heap memory, production environment is recommended to set above 1024m
-xx:permsize=64m JVM Initial allocation of non-heap memory, will not be recycled, production environment is recommended to the same as MaxPermSize, set to more than 256m
-xx:maxnewsize=512m JVM Heap Area The maximum assignable size of Cenozoic memory (PermSize is not a heap), production environment is recommended to be set to 800m-1024m
-xx:maxpermsize=128m JVM Maximum allowable allocated non-heap memory, production environment recommended set to 256m or more
Maximum heap memory and maximum non-heap memory are limited by the operating system
About-djava.awt.headless=true
For a Java server, some graphical elements, such as map creation or graphics and graphs, are often processed. These APIs basically always need to run a x-server in order to be able to use the AWT (abstract window Toolkit, abstracted Windows toolset). However, running an unnecessary x-server is not a good way to manage your network.
This solution depends on your Java version. If you run on JDK1.4, then you will have the opportunity to run the headless server.
-djava.awt.headless=true
For JDK1.3 and lower versions, there is a PJA toolkit from Eteks (pure Java AWT Toolkit, the plain Java AWT toolset) that can be used. It is a Headlessjava server that is configured to be very similar to Sun's version 1.4, and this configuration includes a set of-D attribute flags. Otherwise it will be reported
Can ' t connect to X11 Window server using ': 0.0′as the value of the DISPLAY variable
Abnormal
Tomcat startup Parameters Xms, Xmx, Xx:maxnewsize, Xx:permsize,-xx:maxpermsize, Djava.awt.headless