Hi, On Wed, 2019-09-11 at 17:08 +0000, Yan Gang wrote: > hi all: > I run 100 threads performance test, use perf top display: > > 71.13% libjvm.so [.] > ParNewGeneration::real_forwardee_slow > > ParNewGeneration::real_forwardee_slow waste some CPU time. I search > google > > ParNewGeneration::real_forwardee_slow belong > of parNewGeneration.cpp, also is JDK bug: > https://bugs.openjdk.java.net/browse/JDK-7171273.
The referenced CR only says that this busy-loop is inefficient cpu- wise, not that waiting for another thread should be made substantially faster :) The other problem is that the waste_some_time() is probably completely optimized away with current compilers (constant folded), so hammering that cacheline (with reads) quite a bit. (I believe that there is a CR for that as well somewhere, but maybe we haven't because of CMS obsolescence). If that real_forwardee_slow() method shows up a lot, *maybe* the amount of parallel gc threads used is too high, i.e. threads stepping on each other's toes all the time. > replaced to G1? Our (Oracle's) general advice when having problems with CMS is to try G1, but recent JDKs ship with other GCs that may be suitable to your application (ZGC, Shenandoah, potentially Parallel GC). CMS is on the way out in _future_ releases (see _draft_ JEP https://openjdk.java.net/jeps/8229049). We at Oracle recommend looking into alternatives. Thanks, Thomas _______________________________________________ hotspot-gc-use mailing list hotspot-gc-use@openjdk.java.net https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use