@monorail mastodon seems to be a huge resource hog, compared to anything else i've tried to host anyway
you could possibly tone down the number of sidekiq and/or puma workers to ease memory usage a bit
but aside from that, not sure what you could do besides downloading more ram