exception_handler
exception_handler copied to clipboard
Excessive memory usage on Heroku
I got this working on Heroku (thanks for the great gem!) However, now that it's running, it tends to eat up a ton of memory. It seems like a gem that's doing something relatively straightforward like this shouldn't take up 100MB+ of memory on Heroku, so perhaps there's some issue with it.
I use Scout on Heroku to check memory usage, and this gem is using more memory than any other page in my app by far, so it'd be awesome if you could figure out what's going on. That said, the dump from Scout didn't help me much in figuring out what was up - here's what it tells me:
Router/Rails
1 call
100%
exception_handler/exceptions/show
1 call
0%
...
Middleware
1 call
0%
Controller
1 call
0%
RedirectRule#find
SQL
1 call
0%
As you can see, "Router/Rails" appears to be the culprit, but I'm not sure what to do about that. None of my other pages see this kind of memory increase in the Router. Any ideas? Let me know if you need more info.
VERY interesting.
The gem itself just uses all rails' native functionality... so I don't see why it would cause 100mb of memory usage. Are there any deeper reports you have access to?
Thanks for the kind words!
On 29 June 2018 at 07:52 wemmick [email protected] wrote:
I got this working on Heroku (thanks for the great gem!) However, now that it's running, it tends to eat up a ton of memory. It seems like a gem that's doing something relatively straightforward like this shouldn't take up 100MB+ of memory on Heroku, so perhaps there's some issue with it. I use Scout on Heroku to check memory usage, and this gem is using more memory than any other page in my app by far, so it'd be awesome if you could figure out what's going on. That said, the dump from Scout didn't help me much in figuring out what was up - here's what it tells me: Router/Rails 1 call 100% exception_handler/exceptions/show 1 call 0% layouts/_header 1 call 0% Rendering 1 call 0% GradeLevel#find SQL13 ROWS 2 calls 0% layouts/_header_search 1 call 0% layouts/_footer 1 call 0% ResourceFormat#find SQL16 ROWS 1 call 0% layouts/_content_footer 1 call 0% layouts/_shim 1 call 0% Middleware 1 call 0% Controller 1 call 0% RedirectRule#find SQL 1 call 0% — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/richpeck/exception_handler/issues/65 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABDaL3680TmENCnUCX0LY2jkxqOu825Eks5uBc7DgaJpZM4U8hvT .
This is the trace I get from Scout on Heroku - does it help? It looks like the bloat is all in the Router, but I'm not sure what can be done about that.

Many thanks, will investigate this myself - not sure why it would be eating memory like that.
Does the app have any other memory leaks or is it just with ExceptionHandler?
As far as I can tell, it's just ExceptionHandler. I haven't seen memory usage at that scale on any other pages, and I've never seen significant usage coming from the router. Any help would be much appreciated!
Got the same results on Heroku for one of our apps - looking at the issue but still unsure as to what's causing it.
Hi Rich, any insights on this?
Still looking - sorry for the late response; for some reason, the email response didn't register as a comment!