If you are still using ImageMagick, first thing you should do is replace it with libvips. For a complete explanation, check my post here, as it explains why Heroku + Active Storage + ImageMagick is so problematic
Also, I’m not sure if you are using proxy or redirect. Redirect should not consume extra memory, but proxy will, so make sure you have a CDN in front of you (Cloudflare) that can absorb some of the impact.