ipacel / flag Goto Github PK
View Code? Open in Web Editor NEW使用 Shenandoah GC 和一些性能优化功能的MC服务器启动参数
License: MIT License
使用 Shenandoah GC 和一些性能优化功能的MC服务器启动参数
License: MIT License
如 https://github.com/cyberpwnn/MC-Java-Flags 其中 https://www.evanjones.ca/jvm-mmap-pause.html 里就有提到
+PerfDisableSharedMem – 导致 GC 写入文件系统,如果磁盘 IO 较高,这可能会导致严重延迟。
https://malloc.se/blog/zgc-jdk17 里有讲到 zgc 在17的动态GC调整 -XX:+UseDynamicNumberOfGCThreads
Dynamic Number of GC Threads
动态GC线程数
The JVM has for a long time had an option called -XX:+UseDynamicNumberOfGCThreads. It’s enabled by default and tells the GC to be smart about how many GC threads it’s using for various operations. The number of threads used will be constantly re-evaluated and can thus vary over time. This option is useful for several reasons. For example, it can be hard to figure out what the optimal number of GC threads is for a given workload. What usually happens is that you try various settings of -XX:ParallelGCThreads and/or -XX:ConcGCThreads (depending on which GC you are using) to see which seems to give the best result. To complicate things, the optimal number of GC threads might vary over time as the application goes through different phases, so setting a fixed number of GC threads can be inherently sub-optimal.
JVM很长一段时间以来都有一个叫做选项。它在默认情况下是启用的,它告诉GC要聪明地知道它在执行各种操作时使用了多少个GC线程。所使用的线程数将不断地重新评估,因此可以随着时间的推移而变化。由于几个原因,此选项很有用。例如,对于给定的工作负载,很难确定GC线程的最佳数量。通常情况下,您会尝试和/或的各种设置(取决于您使用的GC),以查看哪个似乎可以给予最佳结果。更复杂的是,GC线程的最佳数量可能会随着应用程序经历不同阶段而变化,因此设置固定数量的GC线程可能本质上是次优的。
Until JDK 17, ZGC ignored -XX:+UseDynamicNumberOfGCThreads and always used a fixed number of threads. During JVM startup, ZGC used heuristics to decide what that fixed number (-XX:ConcGCThreads) should be. Once that number was set it never changed again. Starting with JDK 17, ZGC now honors -XX:+UseDynamicNumberOfGCThreads and tries to use as few threads as possible, but enough threads to keep up collecting garbage at the rate it’s created. This helps to avoid using more CPU time than needed, which in turn will make more CPU time available to Java threads.
在JDK 17之前,ZGC一直忽略并使用固定数量的线程。在JVM启动期间,ZGC使用启发式方法来决定固定数字()应该是什么。这个数字一旦设定,就再也没有改变过。从JDK 17开始,ZGC现在尊重并尝试使用尽可能少的线程,但要有足够的线程来保持垃圾的创建速度。这有助于避免使用超出需要的CPU时间,从而使Java线程有更多的CPU时间可用。
Also note that when this feature is enabled, the meaning of -XX:ConcGCThreads changes from “Use this many threads” to “Use at most this many threads”. But unless you have an unconventional workload you typically don’t need to fiddle with -XX:ConcGCThreads. ZGC’s heuristics will pick a good max number of threads for you, based on the size of the system you are running on.
另外请注意,当启用此功能时,含义将从“使用这许多线程”更改为“最多使用这许多线程”。但除非你有一个非常规的工作量,你通常ZGC的启发式方法将根据您运行的系统的大小为您选择一个合适的最大线程数。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.