JVM server startup parameters

    Recently, I have been using Python and Java together. I feel that Python is still much more flexible than Java. Today, I need to deploy a java service to docker to customers, and then check the JVM parameters generally set. There are many online. . But they only give commands without explanation. . . I dare not do so. . . So I searched for an explanation based on the parameters on the Internet, what it does, and then deleted it according to the needs!

// server mode

-server         

//minimum memory                  

–Xms2G

// max memory

–Xmx2G

//Maximum persistent generation memory

-XX:MaxPermSize=512m

// limit the use of memory to avoid overflow

-XX:-UseGCOverheadLimit

//Old generation collector

-XX:+UseParallelOldGC

//New generation collector

-XX:+UseParallelGC

//JIT optimization  http://ju.outofmemory.cn/entry/271207

-XX:MaxInlineSize=1024

//Image processing optimization  http://lj6684.iteye.com/blog/986898

-Djava.awt.headless=true

//Use ImageMagick related, not clear yet

-Djmagick.systemclassloader=no

//Solve the problems involving IPV4 and IPV6 in network programming  https://blog.csdn.net/wodeyuer125/article/details/50502989

-Djava.NET.preferIPv4Stack=true

//Set the default connection host timeout time in milliseconds

-Dsun.Net.client.defaultConnectTimeout=60000

//Set the default read data timeout unit from the host in milliseconds

-Dsun.net.client.defaultReadTimeout=60000

//Set the DNS cache time for successful resolution  https://my.oschina.net/sub/blog/151717

-Dnetworkaddress.cache.ttl=300

// same as above

-Dsun.net.inetaddr.ttl=300

-jar  ***.jar

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325306200&siteId=291194637