Ruby 4.1.0-preview1 Adds Per-Ractor Garbage Collection and Windows YJIT Support, and Limits Class Changes to the Owning Ractor
Ruby's 4.1.0-preview1, published 12 October 2026, runs the default GC per Ractor, limits class modification to the owning Ractor and adds YJIT on Windows mswin.
Overview
The Ruby core team published Ruby 4.1.0-preview1 on 12 October 2026. In its announcement on ruby-lang.org, the project says “Ruby 4.1 introduces Ractor local GC, Windows support of YJIT, autoload_relative,” and other improvements. The GitHub release page carries the same NEWS text and is flagged as a pre-release, so it is a preview rather than a stable version. The announcement says the release spans 6116 files changed, 311387 insertions and 219997 deletions since Ruby 4.0.0.
What the release notes say
Per-Ractor garbage collection. According to the announcement, the default GC now runs per Ractor: each Ractor collects its own heap on its own thread without stopping the others, and a stop-the-world collection runs only when needed, such as an explicit full GC.start. The project’s claim is that “Allocation-heavy Ractor programs now scale like forked processes”; the announcement gives no benchmark for it. GC.start(global: false) forces a Ractor-local collection, while by default GC.start still runs a global GC.
The notes also list behavior changes: Ractor#value returns the value only once, and a second call raises Ractor::Error. Ractor#monitor now sends an Array, either [ractor, :exited] or [ractor, :aborted], where it previously sent a bare Symbol.
Class ownership. In the compatibility section, the announcement states that a class or module can now be modified only by the Ractor that created it, its owner. Defining or removing methods, alias, include/prepend and similar changes raise Ractor::IsolationError in any other Ractor, while reading is unchanged. Because everything defined at boot or by the main Ractor is owned by the main Ractor, a non-main Ractor can no longer monkey-patch it. Kernel#at_exit and END {} also raise Ractor::IsolationError in a non-main Ractor.
Allocator. The same notes say the default garbage collector has been switched from a freelist allocator to a bump pointer allocator, referencing PR #17201.
YJIT on Windows. YJIT now supports Windows (mswin) on x64 CPUs, per the GitHub release notes. It is configured with win32\configure.bat --enable-yjit, needs rustc with the x86_64-pc-windows-msvc target, and only the release build is supported; MinGW is not.
Language and library changes. The notes add Kernel#autoload_relative and Module#autoload_relative, which resolve a file path relative to the calling file, similar to require_relative. They also add Integer#bit_count, Module#descendants and Range#clamp, make all Regexp instances frozen, and make Symbol#to_s return a frozen string. The bundled gems net-ftp and net-pop are removed, though the notes say they remain installable from rubygems.org. RUBY_MN_THREADS gains new values, -1 and 2, for controlling M:N thread scheduling.
Deprecations and removals
According to the GitHub release notes, Module#ruby2_keywords and Proc#ruby2_keywords are deprecated and will be removed in Ruby 4.4, and Hash.ruby2_keywords_hash? is deprecated and will be removed in Ruby 4.5. A fallback to Object in alias lookups now emits a deprecation warning and is scheduled for removal in Ruby 4.3.
The notes list ObjectSpace._id2ref as removed. Prior Machine Herald coverage said Ruby 4.0 had removed it. The Ruby 4.0.0 release notes say only that ObjectSpace._id2ref “is deprecated”, so the removal appears in 4.1.0-preview1, not 4.0.
What we don’t know
Both sources are project-authored, and neither provides performance figures for the per-Ractor GC or the new allocator. The notes do not give a date for a final Ruby 4.1.0 or further previews. Whether the Ractor ownership rules will break existing gems that patch classes from non-main Ractors is not addressed in the notes.