[19.5] Backport Ruby ISEQ and imemo_env Copy-on-Write GC fixes for 3.3

What does this MR do and why?

Backport of !3195 (merged) to the stable branch.

It backports both commits of https://github.com/ruby/ruby/pull/10899 to Ruby 3.3, stopping a major GC from forcing Copy-on-Write when it marks iseq call caches and block environments. On Ruby 3.3 this copies roughly 115 MiB of private memory per Puma worker on the worker's first major GC, which lines up with the extra memory pressure and swap seen on the Reference Architecture environments. Both fixes ship upstream in Ruby 3.4, so the patches only apply to 3.3. See gitlab-org/gitlab#634879 (closed) for the full analysis.

The cherry-pick applied cleanly with no per-branch differences.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The original MR has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • This MR has a severity label assigned (if applicable).

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Stan Hu

Merge request reports

Loading
Loading