NOTE

2.1 GC Tuning

GC tuning balances CPU overhead, pause duration, and memory usage. These notes begin with setting goals and organize evaluation and adjustment steps.

Garbage Collection / RuntimeCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. GC Tuning Steps

1.1. Determine the Goal of GC Tuning

  • CPU utilization: to what extent does the collection algorithm slow down the program? Sometimes this is described as the proportion of CPU time spent on collection compared with other work.
  • GC pause time: how long will the collector pause the program? In current GC, pauses that may be caused by both STW and Mark Assist need to be considered.
  • GC pause frequency: how frequently does the collector cause pauses? In current GC, pauses that may be caused by both STW and Mark Assist need to be considered.
  • GC scalability: how does the garbage collector perform as heap memory grows? This may not be a concern for most programs.

1.2. Observe GC

1.3. Tuning

1.3.1. Tune Parameters

1.3.2. Tune Code

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub