Coder Social home page Coder Social logo

flag's People

Contributors

aplini avatar safesaffawa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

safesaffawa

flag's Issues

建议更多内容优化jvm参数

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的启发式方法将根据您运行的系统的大小为您选择一个合适的最大线程数。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.