Relative Performance of Java's Garbage First (G1) Garbage Collector?

前端 未结 5 2077
你的背包
你的背包 2021-01-31 03:28

Does anyone know of any performance benchmarks of Java\'s new Garbage First (G1) Garbage Collector (as compared to the \"old\" GCs)?

In terms of GC pause times, Sun sta

5条回答
  •  不知归路
    2021-01-31 04:12

    UPDATED: see below

    If you have a web application, or another application that handles a lot of clients/req, and the response time is important for you, then you better use CMS. this test was found in 'Java performance and scalability'

    UPDATE : 18 Nov 2019

    Here are compared the pauses for each garbage collector. Its 2019 and I think that best option for WebApp is still CMS, until you can switch directly to ShenandoahGC (skip G1)

    link : ShenandoahGC Main

    It is important to understand that GC pauses might not be the only significant contributor to response times in regular applications. Having large GC pause spells the problem with response time with a very high probability, but the absence of long GC pauses does not always mean decent response time. Queueing delays, network latencies, other services latencies, OS scheduler jitter, etc. could be the contributing cost. Running Shenandoah with response time measurement is recommended to get the full picture of what is going on in the system, which can then be used to correlate with GC pause time statistics.

    For example, this is a sample report with jHiccup on one of the workloads:

提交回复
热议问题