GC Points in a Threaded Environment

  • Authors:
  • Ole Agesen

  • Affiliations:
  • -

  • Venue:
  • GC Points in a Threaded Environment
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many garbage-collected systems, including most that involve astop-the-world phase, restrict GC to so called GC points. Insingle-threaded environments, GC points carry no overhead: when aGC must be done, the single thread is already at a GC point. Inmulti-threaded environments, however, only the thread that triggersthe GC by failing an allocation will be at a GC point. Otherthreads must be rolled forward to their next GC point before the GCcan take place. We compare, in the context of a high-performanceJavaTM virtual machine, two approaches to advancingthreads to a GC point, polling and code patching, while keeping allother factors constant. Code patching outperforms polling by anaverage of 4.7% and sometimes by as much as 11.2%, while costingonly slightly more compiled code space. Put differently, since mostprograms spend less than 1/5 of the time in GC, a 4.7% bottom-linespeedup amounts to more than a 20% reduction in the GC-relatedcosts. Patching is, however, more difficult to implement.