Rails 7.2: Disabled YJIT on Heroku Due to High Memory Utilization
As mentioned in the previous post, YJIT is enabled by default since Rails 7.2.
Rails 7.2: Disabled YJIT on Heroku Due to High Memory Utilization

As mentioned in the previous post, YJIT is enabled by default since Rails 7.2.
It normally gives you performance benefits, but as pointed out in this post, it may also cause some memory util increase, which can be problematic in a memory-constrained environment like servers on Heroku.
My Rails app experienced the memory increase after upgrading Rails to 7.2.
I tried reducing the memory allocation cap to YJIT with the environment variable RUBYOPT="--yjit-mem-size=64" and even with RUBYOPT="--yjit-mem-size=32", but none of them could resolve the issue in my case.
Eventually, I turned YJIT off and it worked as shown in the graph below:

Just sharing this in case someone who is running Rails apps on Heroku also encounters the same problem after the 7.2 upgrade.
메타데이터
- post_id
- a1a2d77cf256
- slug
- rails-7-2-disabled-yjit-on-heroku-due-to-high-memory-utilization-a1a2d77cf256
- url
- https://medium.com/@kei178/rails-7-2-disabled-yjit-on-heroku-due-to-high-memory-utilization-a1a2d77cf256
- canonical_url
- https://medium.com/@kei178/rails-7-2-disabled-yjit-on-heroku-due-to-high-memory-utilization-a1a2d77cf256
- author_url
- https://medium.com/@kei178
- status
- ok
- fetched_at
- 2026-07-19 14:09:49