In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to optimize the startup parameters of SpringBoot based on the JDK8 version, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Run the project command on the Linux side
Java-jar-XX:MetaspaceSize=128m-XX:MaxMetaspaceSize=128m-Xms1024m-Xmx1024m-Xmn256m-Xss256k-XX:SurvivorRatio=8-XX:+UseConcMarkSweepGC springboot project .jar
Parameter introduction
-XX:MetaspaceSize=128m (default size of metaspace)
-XX:MaxMetaspaceSize=128m (maximum metaspace size)
-Xms1024m (heap maximum size)-Xmx1024m (heap default size)
-Xmn256m (Cenozoic size)-Xss256k (maximum depth size)
-XX:SurvivorRatio=8 (Cenozoic partition ratio 8:2)
-XX:+UseConcMarkSweepGC (specify the garbage collector to use, where the CMS collector is used)
-XX:+PrintGCDetails (print a detailed GC log)
explain
JDK8 later removed-XX:PermSize and-XX:MaxPermGen, and replaced it with-XX:MetaspaceSize=128m (default size of metaspace)-XX:MaxMetaspaceSize=128m (maximum size of metaspace) JDK8 began to put the class metadata into localized heap memory (native heap), an area called Metaspace, which is called metaspace in Chinese. What are the benefits of using localized memory? The most direct manifestation is java.lang.OutOfMemoryError: the PermGen space problem will no longer exist, because the default class metadata allocation is only limited by the size of local memory, that is, how much local memory is left, how much Metaspace can theoretically have (it seems that the capacity is also related to the virtual memory of the operating system? It is not clear here), which solves the problem of insufficient space. However, it is obviously not realistic to make the Metaspace infinite, so we also want to limit the size of the Metaspace: use the-XX:MaxMetaspaceSize parameter to specify the size of the Metaspace area. By default, JVM dynamically sets the size of the MaxMetaspaceSize at run time as needed.
JDK7 and JDK8 JVM memory structure diagram
The above content is based on the JDK8 version of SpringBoot startup parameter optimization is like, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.