Skip to content

Release AST nodes after visiting array elements#9369

Open
hsbt wants to merge 1 commit intomasterfrom
fix-gh-9368
Open

Release AST nodes after visiting array elements#9369
hsbt wants to merge 1 commit intomasterfrom
fix-gh-9368

Conversation

@hsbt
Copy link
Member

@hsbt hsbt commented Mar 6, 2026

Fixes #9368

Copilot AI review requested due to automatic review settings March 6, 2026 00:44
@hsbt
Copy link
Member Author

hsbt commented Mar 6, 2026

@mhashizume Could you try this patch with your environment? Unfortunately, I don't have 32bit platform.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses RubyGems SafeMarshal memory pressure during large array conversions by ensuring AST array elements are eligible for GC as they’re consumed, targeting the memory exhaustion reported in #9368.

Changes:

  • Clear each visited Elements::Array entry (elements[idx] = nil) after converting it to a Ruby object to release AST nodes earlier.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@mhashizume
Copy link

@mhashizume Could you try this patch with your environment? Unfortunately, I don't have 32bit platform.

I'm still seeing the same behavior with this patch applied

@hsbt
Copy link
Member Author

hsbt commented Mar 9, 2026

@mhashizume Thanks. I don't have target platform so it's just guesswork, but I'll think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory exhaustion on AIX 7.2 on Rubygems >= 4.0

3 participants