We are facing the same problem and have decided to let Newrelic do the heavy lifting and help us with the diagnostic. There are some free Newrelic plans you might be able to use for that, but if none of them go deep enough into your code, you might want to consider paying for the Pro version for one month to help you profile your app.
I can't help you any further with this because we are about to switch to Pro (waiting for Newrelic to accept the plan) so don't have any more insight, but thought it might help you to look at it.
If you don't want to use Newrelic, Heroku also has a lab feature that will profile memory usage and report to the logs, enable it with:
heroku labs:enable log-runtime-metrics
Then it will show you how much memory each of your dynos is using.
The error you're getting is when the memory on Heroku exceeds the memory quota. Heroku has this to say about it:
Dynos whose processes exceed their memory quota are identified by an
R14 error in the logs. This doesn’t terminate the process, but it does
warn of deteriorating application conditions: memory used above quota
will swap out to disk, which substantially degrades dyno performance.
This page has more info.