Has anyone found Garbage Collection tuning to be useful?

前端 未结 6 1783
忘了有多久
忘了有多久 2021-01-01 13:08

I\'ve read plenty of articles about tuning GC in Java and have often wondered how many people really use some of the more advanced features.

I\'ve always av

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 13:34

    I have but not recently. The application that I was working on was real-time rendering of a video stream constructed of individual motion JPEG images. At the time (circa JDK 1.2 and 1.3), the -Xincgc setting would switch the client garbage collector from more of a big bang cleanup to a mode where a bit of garbage was cleaned up regularly. As a result, the distribution of frame latencies was much lower, giving the impression of a smoother video (instead of 1-2-3-pause, 1-2-3-pause).

    I haven't looked at that code in quite a long time but I strongly suspect that, with the modern garbage collection algorithms, -Xincgc would actually decrease performance.

    In today's world, I would say that standard optimization skepticism should always apply: profile profile profile. Are you sure that the bottleneck is really the garbage collector...?

提交回复
热议问题