Has anyone found Garbage Collection tuning to be useful?

前端 未结 6 1784
忘了有多久
忘了有多久 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:36

    Part of my current job is the care and feeding of a large java application that was designed to run with a large amount of memory (currently around 8 Gb), mostly due to ongoing calculations with lots of cached data. I did the initial deployment with the standard GC setup , mostly because there wasn't a simple way to simulate the production environment running at full tilt.

    In stages, over the next few months, I've customized the GC settings. Generally, the biggest available knob seems to be adjusting the frequency and magnitude of incremental gc - the biggest improvement has been in trading off large periodic gc for smaller and more frequent ones. But we've definitely been able to see performance improvements.

    I'm not going to post my specific settings because a) they're specific to our setup, and b) because I don't have them handy :). But in general, what I've found is

    • there's been a lot of work done in tuning the default gc settings. Almost always the defaults work better than any tweaks I would make.
    • At least for me, the situations where gc tuning was actually worthwhile were extreme enough that it was unreasonable to attempt to simulate them, so I had to do it experimentally and incrementally.

    Here's a good reference from a prev. stackoverflow discussion.

提交回复
热议问题