Memory hog since v4.7.0 - server fills up RAM with sidekiq threads
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 50.3k
- Forks
- 7.5k
- Avg merge
- 12h 54m
- Merged PRs (30d)
- 247
Description
Steps to reproduce the problem
- Deploy Mastodon v4.7.x
- Monitor RAM usage
- It fills up gradually over the days
Expected behaviour
Memory RAM usage should remain within nominal boundaries
Actual behaviour
RAM fills up over the days and does not seem to be released.
Detailed description
RAM consumption seems to stem from a great number of sidekiq threads (> 3,000 after one day, despite -c 30 in systemd sidekiq service).
It will grow by 20% within three to four days on a 32 GB RAM server (with over half of it free on starting Mastodon).
A restart of Mastodon processes resets memory usage (RAM is freed), and then it starts over again, consistently.
This did not happen on versions prior to v4.7 branch.
Mastodon instance
gayfr.social
Mastodon version
v4.7.1 (started on v4.7.0)
Technical details
- Ruby version: 4.0.6
- Node.js version: 24.20.0
- Native install (no docker) on Ubuntu 24.04LTS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the gradual RAM and Sidekiq-thread growth on Mastodon v4.7.1 using the native Ubuntu systemd setup described in the report, while monitoring process and thread counts over several days. Compare behavior with a pre-v4.7 version if available; done means identifying the regression and confirming that memory and thread usage remain within expected bounds after the fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend, devops, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100