Skip to content
GitLab

Ruby 2.7: Understand and debug problems with heap compaction

Apr 28, 2021Matthias Käppler10 min read
Opens about.gitlab.com
What the post coversAI, from the source post

This post details the investigation and resolution of a production incident caused by Ruby 2.7's heap compaction feature when used with Puma's 'nakayoshi_fork'.

  • It explains the concepts of tenuring objects and heap compaction, the challenges encountered with C-extensions like Hamlit due to improper object marking, and the specific fix implemented in Hamlit to resolve segfaults by statically resolving constants and using `rb_gc_register_mark_object`.
  • It also highlights the need for more reliable detection of compaction-related issues in CI.
Read the full post on about.gitlab.com · 10 min (opens in a new tab)

More from the Performance Optimization trail